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

zsh completion is too strict on command line args #850

Closed
laishulu opened this issue Feb 15, 2017 · 6 comments
Closed

zsh completion is too strict on command line args #850

laishulu opened this issue Feb 15, 2017 · 6 comments
Labels
A-completion Area: completion generator C-enhancement Category: Raise on the bar on expectations E-help-wanted Call for participation: Help is requested to fix this issue.

Comments

@laishulu
Copy link

laishulu commented Feb 15, 2017

Rust Version

rustc 1.17.0-nightly (29dece1c8 2017-02-08)

Affected Version of clap

"clap 2.20.3 (registry+https://github.com/rust-lang/crates.io-index)",
name = "clap"
"checksum clap 2.20.3 (registry+https://github.com/rust-lang/crates.io-index)" = "f89819450aa94325998aa83ce7ea142db11ad24c725d6bc48459845e0d6d9f18"

Expected Behavior Summary

myapp --foo1 bar1 --foo2 bar2 --foo3 bar3 --<tab>
then list candidates for more args.

Actual Behavior Summary

when myapp --foo1=bar1 --foo2=bar2 --foo3=bar3 --<tab> , auto complete works perfect.
but if I use space instead of the = symbol, auto complete doesn't work.

@kbknapp
Copy link
Member

kbknapp commented Feb 15, 2017

I'm not sure I understand the issue entirely. Are you saying the candidates don't include the = but you'd like them to, or there are missing valid candidates?

@laishulu
Copy link
Author

laishulu commented Feb 15, 2017

when myapp --foo1=bar1 --foo2=bar2 --foo3=bar3 --<tab> , auto complete works perfect.
but if I use space instead of the = symbol, auto complete doesn't work.

@kbknapp
Copy link
Member

kbknapp commented Feb 15, 2017

Ah ok! I understand, thanks.

I think this has to do with how Zsh completion works and isn't specific to clap. In Bash completion scripts there's a way to tell the interpreter that a value follows certain options, but I'm not aware of a way to do this in Zsh.

I'm open to suggestions on how to make the completion generation better.

@kbknapp kbknapp added A-completion Area: completion generator D: intermediate E-help-wanted Call for participation: Help is requested to fix this issue. C-enhancement Category: Raise on the bar on expectations labels Feb 15, 2017
@segevfiner
Copy link
Contributor

This might have been fixed by #1141. Needs testing.

@pksunkara
Copy link
Member

@segevfiner @laishulu I don't have zsh and I tried testing it with mac's default zsh (5.3) and I keep getting _arguments not found. If one of you could test and respond back, that would be great.

@intgr
Copy link
Contributor

intgr commented Apr 8, 2020

By pksunkara's request, I tested with the example program in PR #1793, this issue is fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-completion Area: completion generator C-enhancement Category: Raise on the bar on expectations E-help-wanted Call for participation: Help is requested to fix this issue.
Projects
None yet
Development

No branches or pull requests

5 participants