-
-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support fish correct completion for nested subcommands #2715
Labels
Comments
Hmm, maybe this would have been rather a bug than a feature |
I wouldn't worry about subcommand chains since they are not supported in clap. |
pksunkara
added
C-bug
Category: Updating dependencies
A-completion
Area: completion generator
and removed
T: new feature
labels
Aug 18, 2021
I did not mean chained commands, I meant multiple level of subcommands, where the naming is repeating. |
I'll have a look at how the simple version can be implemented. |
ModProg
added a commit
to ModProg/clap
that referenced
this issue
Aug 19, 2021
* Prevent completing subcommands that were already completed * Make sure all parent subcommands actually existent Partially fixes clap-rs#2715
ModProg
added a commit
to ModProg/clap
that referenced
this issue
Aug 19, 2021
* Prevent completing subcommands that were already completed * Make sure all parent subcommands actually existent Partially fixes clap-rs#2715
ModProg
added a commit
to ModProg/clap
that referenced
this issue
Aug 20, 2021
* Prevent completing subcommands that were already completed * Make sure all parent subcommands actually existent Partially fixes clap-rs#2715
ModProg
added a commit
to ModProg/clap
that referenced
this issue
Aug 20, 2021
* Prevent completing subcommands that were already completed * Make sure all parent subcommands actually existent Partially fixes clap-rs#2715
ModProg
added a commit
to ModProg/clap
that referenced
this issue
Aug 20, 2021
* Prevent completing subcommands that were already completed * Make sure all parent subcommands actually existent Partially fixes clap-rs#2715
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Please complete the following tasks
Clap Version
master
Describe your use case
There are two cases where the current solution does not work:
Simple case (can be solved with fish build-ins)
Example command syntax:
command A B <parameter>
command A C <parameter>
Currently pressing tab after writing
A
it will completeB
as well asC
again.Complex case (we probably would need to write something our own)
Probably wont happen that often:
Two subcommand chains:
command A B C
command B A D
These are even with the simple solution not differentiable.
Describe the solution you'd like
Simple Case
Instead of only requirering the parent subcommand to exist, rather also check that self and the sibling commands do not exist:
Complex case
Not sure how to solve. Probably need something like
clap/src/completions.rs
Lines 237 to 248 in a61eaf8
With fish buildins
A B
andB A
is the same. Therefor you would get bothC
andD
for both. The same would happen if at some point a subcommand gets repeated (maybe more likely than theAB
BA
example).Insufficient solution using standard
complete
functionalityAlternatives, if applicable
No response
Additional Context
This is somewhat a regression see #685
The text was updated successfully, but these errors were encountered: