Clap outputs wrong error message context when using an environment variable with invalid content #5202
Open
2 tasks done
Labels
A-parsing
Area: Parser's logic and needs it changed somehow.
C-bug
Category: Updating dependencies
S-waiting-on-design
Status: Waiting on user-facing design to be resolved before implementing
Please complete the following tasks
Rust Version
rustc 1.72.1 (d5c2e9c34 2023-09-13)
Clap Version
clap: 4.1.4, clap_derive: 4.1.0
Minimal reproducible code
Config.toml
Steps to reproduce the bug with the above code
Actual Behaviour
When running the above command with an invalid value for the environment variable (parser error),
then clap does not output the correct context of the wrong value. It outputs that the cli argument was set wrongly,
but the user have used an environment variable not the cli argument.
Expected Behaviour
For good use-ability it shall output the correct error message context, for example:
Additional Context
The background is better use-ability. A user might forgot that an environment variable was set manually and tries to execute the program. With the current error message context he gets confused, because he thinks that he did not set this argument.
Debug Output
The text was updated successfully, but these errors were encountered: