nushell
nushell copied to clipboard
Custom completions should support subcommands after flags
Related problem
I would like to be able to represent subcommands after flags when working with custom completions: Often the top level command will have flags that it's necessary to put before the subcommand.
$ cmd --flag subcmd --subflag foo
My naive way of representing this command would be:
export extern cmd [
--flag
...args
]
export extern "cmd subcmd" [
--subflag
bar: string
]
But then the completions bottom out after cmd --flag, and I don't get the completions for subcmd
Describe the solution you'd like
It would be great if cmd <options> subcmd just worked, so that after the flags, it "passes through" to the extern "cmd subcmd" definition and uses those completions.
Describe alternatives you've considered
No response
Additional context and details
No response