When the user specifies a global, the env variable is still validated #5588
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.79.0 (129f3b996 2024-06-10)
Clap Version
4.5.9
Minimal reproducible code
Steps to reproduce the bug with the above code
Cargo.toml:
Run with:
Afterwards, remove
global = true
ORenv = "V"
and observe that it works.Actual Behaviour
Expected Behaviour
When removing
global = true
orenv = "V"
it works correctly:Additional Context
The purpose of this code is to allow passing
V=1
to a function that sets up logging before clap is run. Sinceenv_logger
cannot change its level once it's initialized, we need to do this odd dance.The issue here is that behaviour changes with
env = "V"
andglobal = true
. It seems to only happen when the following three things are true:global = true
ANDenv = "V"
-v
is specifiedIf any condition is missing, the issue does not trigger.
Debug Output
The text was updated successfully, but these errors were encountered: