Add the ability to add alternative names for subcommand variants with #[clap]
attribute
#3639
Closed
2 tasks done
Labels
C-enhancement
Category: Raise on the bar on expectations
Please complete the following tasks
Clap Version
3.1.9
Describe your use case
It would be nice if we could add alternative names for subcommands.
E.g. a
Build(BuildCmd)
command for cargo might offer:It would be nice if we could easily add shorthand aliases for this command. E.g.
I believe this is currently possible for options, but I didn't come across a solution for subcommands.
Currently, the only solution I'm aware of for aliasing subcommands is to add further variants, e.g.
however I think we run into duplicated help docs here.
Describe the solution you'd like
Perhaps something along the lines of
Or something like:
or
#[clap(short = "b")]
By having a dedicated macro, we could generate dedicated documentation that describes the command is an alias or shorthand for the longer form.
Alternatives, if applicable
No response
Additional Context
No response
The text was updated successfully, but these errors were encountered: