Open alerque opened 6 months ago
This is blocked on #1232
I looked at that issue before opening this, but don't think it's related. Implementing this does not require dynamic completion support. Delegating to the completions of another command is not at all the same thing as using the output of a command as completions, and the plumbing needed to make shells do this is different (and simpler).
We plan to completely change our completion system, see #3166.
Doing major re-work of our existing completions to fit this is a bit of a dead end and could put us in a design bind for when we get to the end state of #3166.
delegate
attribute.
Please complete the following tasks
Clap Version
4.5
Describe your use case
I have an app that has several subcommands, some of which are wrappers around other CLI tools. For example
casile
has several subcommands, but one of them iscasile make
that sets up a special environment and this passes all the remaining args tomake
. I have it setup something like this:The
Vec<String>
seems to be the best way to collect further arguments and pass them through to the subprocess. Since passing other flags tomake
is valid here the arguments beyond this point may or may not be filenames, and even if they are they may or may not exist yet which makes filename completion (as I would get if I made this aVec<PathBuf>
or similar not very useful.Describe the solution you'd like
I'd like to be able to specify something in the CLI that specifically called out the command for which to use completions for:
I don't know what the exact ergonomics should be, but somehow I'd like the final generated completion scripts to delegate completions for arguments in this position to the completion script of a different external command.
Alternatives, if applicable
No response
Additional Context
I'm not sure all supported shells have a way to handle this, but at least bash and zsh do.