Error messages / ContextKind::InvalidArg
should show the flag used instead of always using long
#5748
Open
2 tasks done
Labels
A-help
Area: documentation, including docs.rs, readme, examples, etc...
C-enhancement
Category: Raise on the bar on expectations
S-blocked
Status: Blocked on something else such as an RFC or other implementation work.
Please complete the following tasks
Rust Version
rustc 1.81.0 (eeb90cda1 2024-09-04)
Clap Version
4.5.18
Minimal reproducible code
Steps to reproduce the bug with the above code
Actual Behaviour
Expected Behaviour
The value of
InvalidArg
should be"-n <NAME>"
because the user passed-n
, not--name
.Additional Context
If I use
parse_from
like this:I get the following error message:
Again, the long option
--name
is used.This can be confusing to users because the actual arguments and the arguments displayed in the error message are different.
Debug Output
The text was updated successfully, but these errors were encountered: