Open weihanglo opened 1 year ago
I had considered making the it parametrized but thought that might be too complex.
Maybe with a defaulted generic argument it won't be too bad and likely won't be a breaking change.
Alternatively, cargo could ignore the "invalid type" error since its pattern of reuse is a bit weird in of itself.
Even though in some circles, a new defaulted generic parameter is not a breaking change, for how UnknownArgumentValueParser
is used, it is a breaking change so we can't resolve this until clap v5.
Please complete the following tasks
Rust Version
rustc 1.72.0-beta.11 (7a3a43a3b 2023-08-18)
Clap Version
4.3.23
Minimal reproducible code
Steps to reproduce the bug with the above code
Run the script above.
Actual Behaviour
I am not sure if this is expected. It turns out that the unknown argument must be defined as
--flag <string>
. Might be the result ofStringValueParser
in use.Here is the current cargo integration that failed https://github.com/rust-lang/cargo/pull/12529.
keep-going
is always evaluated when constructingBuildConfig
even it is not a valid argument. Cargo provides a default value for unknown argument, which contradicts the definition of bool--keep-going
.Expected Behaviour
UnknownArgumentValueParser
can use with any type of argument.Additional Context
cc #5080
Debug Output
No response