-
-
Notifications
You must be signed in to change notification settings - Fork 1.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
Argument that requires another argument in an argument group gives empty error #4004
Comments
If I read the code correctly, when we generate the error, we know which argument is required but we don't want to report just that one required argument but all of them, so instead of forcing that argument to be present, we delegate to a "missing required" calculator. For some reason it is removing "first" from the list Relevant log entry
|
Say you just run |
When suggesting required arguments, we wanted to avoid an argument showing up in both a group and by itself but we didn't correctly calculate that, causing no required arguments to show up at times. Now, we all use the same pool of information for doing the calculations. This was the type of cleanup that I expected it to drop our binary size but this added 1k to our .text. Strange. Fixes clap-rs#4004
When suggesting required arguments, we wanted to avoid an argument showing up in both a group and by itself but we didn't correctly calculate that, causing no required arguments to show up at times. Now, we all use the same pool of information for doing the calculations. This was the type of cleanup that I expected it to drop our binary size but this added 1k to our .text. Strange. Fixes clap-rs#4004
v3.2.16 is released with the fix for this |
Please complete the following tasks
Rust Version
rustc 1.64.0-nightly (9067d5277 2022-07-28)
Clap Version
3.2.15
Minimal reproducible code
Steps to reproduce the bug with the above code
cargo run -- --require-first --second
Actual Behaviour
Expected Behaviour
Error message should provide context, e.g.
Additional Context
Removing the
multiple(true)
part unintuitively works:This leads me to believe I'm probably misusing
ArgGroup
in this case, however the error message should still say something IMO.Debug Output
The text was updated successfully, but these errors were encountered: