-
-
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
Allow short options to not accept implicitly attached values (-sfoo
)
#4499
Comments
|
Yes, it is working as it is written in the code, as expected. What I'm saying is (I guess,
C-bug
|
Unsure, will have to give it some thought. It seems like some more flexibility around implicitly attached, explicitly attached, and detached values could help with some cases. See also #3030 |
-sfoo
)
btw by disallowing attached values, you might not get
but instead an error about |
Yes, and I've also mentioned that in the table for entry |
Please complete the following tasks
Rust Version
rustc 1.65.0 (897e37553 2022-11-02)
Clap Version
4.0.26
Minimal reproducible code
Steps to reproduce the bug with the above code
cargo r --example pacman -- -Ssi
Actual Behaviour
The above command arguments (
-Ssi
) are interpreted as-S -s i
, thes
flag takesi
as an argument.Expected Behaviour
This behavior did confuse me honestly. I expected same output as from
-Sis test
:(To be fair, I also expected
-Sis
to fail, but it errors witherror: The argument '--search <search>...' requires a value but none was supplied
, I think it should first check for conflicts and then try to parse flag's params.)Additional Context
-Si
-Ss
The argument '--search <search>...' requires a value but none was supplied
-Sis
The argument '--search <search>...' requires a value but none was supplied
-Ssi
-Sis test
The argument '--info' cannot be used with '--search <search>...'
-Ssi test
Found argument 'test' which wasn't expected, or isn't valid in this context
, but really it should sayThe argument '--info' cannot be used with '--search <search>...'
-S -i
-S -s
The argument '--search <search>...' requires a value but none was supplied
-S -i -s
The argument '--search <search>...' requires a value but none was supplied
-S -s -i
✅❔The argument '--search <search>...' requires a value but none was supplied
,which should happen with, it should error with-Ssi
tooThe argument '--info' cannot be used with '--search <search>...'
I apologize for possibly incorrect terminology in the issue title.
Debug Output
The text was updated successfully, but these errors were encountered: