Skip to content
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

fix(complete): Fix zsh handling of multiple arguments #4278

Merged

Conversation

intgr
Copy link
Contributor

@intgr intgr commented Sep 28, 2022

In zsh completion rules, the * denotes whether a flag/argument is allowed multiple times or not. However, in clap 4.0.0, all flag/option rules are always marked with * even if it makes no sense to supply them multiple times, such as --help.

This regressed for flags/options in 6f03b4f, the logic for handling non-multiple arguments with zsh was simply thrown out. While the consequences of this are minor, it's discouraging to see logic discarded without an understanding of why it's there.

The printing of positional multiple args was also tweaked, ValueRange::new(0..=1) should not be treated as multiple values.

intgr referenced this pull request Sep 28, 2022
For num_vals and friends, this only implements hacks until #2688

Fixes #3021
@epage
Copy link
Member

epage commented Sep 28, 2022

While the consequences of this are minor, it's discouraging to see logic discarded without an understanding of why it's there.

I can understand but I don't know zshells completion syntax and do not have ready access to experts in all of the supported shell completion systems to help catch problems.

Really wish there was a way to do end-to-end testing of completions

@epage epage merged commit 7b886d2 into clap-rs:master Sep 28, 2022
@epage
Copy link
Member

epage commented Sep 28, 2022

clap_complete 4.0.1 is out

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants