clap
clap copied to clipboard
completions for subcommand aliases
Please complete the following tasks
- [X] I have searched the discussions
- [X] I have searched the open and rejected issues
Clap Version
4.2.7
Describe your use case
A subcommand called catalog
has aliases dir
and ls
. When clap_complete
generates the zsh script it omits the aliases. As a result if a user tries ls
they will not get the completions, and even worse, it tends to block the shell's natural path completions, making the tool less friendly instead of more.
Describe the solution you'd like
This appears easy to solve, you simply copy the block of the subcommand substituting the alias, such as
(mycommand)
...stuff
;;
(mycom)
...same stuff
;;
Alternatives, if applicable
No response
Additional Context
No response
Without intervention zsh offers the aliases. With the intervention proposed above (tested) it still does so but also allows arguments to be completed. So far I didn't find any downside.
I have not tried with the other shells, except to note that bash is already handling it without any intervention.
Minor note, tried all with clap and clap_complete 4.4.4, all results the same.
isn't this a duplicate of #4265 ?
Thanks for catching that!