You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
error: "filter1_option1" isn't a valid value for '--filters <FILTERS>...'
[possible values: filter1, filter1-option1, filter1-option2, filter2, filter2-option1, filter2-option2]
Did you mean "filter1-option1"?
USAGE:
prog --filters <FILTERS>...
For more information try --help
Expected Behaviour
args: Args { filters: [filter1_option1] }
Additional Context
I get the Expected Behaviour when I flip things and invoke the program with a hyphen, like target/debug/prog -f filter1-option1. My domain users will be familiar with the underscore format so that's what I want to constrain them to and that's what matches options that my enum will match in other aspects of my full fledged program where I noticed this behaviour.
Thanks @epage. That solves my question. Apologies for not finding the answer myself - I searched for keywords "hyphen" and "underscore" when I needed to search for things like "snake-case" and "kebab-case".
Please complete the following tasks
Rust Version
rustc 1.59.0 (9d1b2106e 2022-02-23)
Clap Version
{ version = "3.1.6", features = ["derive"] }
Minimal reproducible code
Steps to reproduce the bug with the above code
cargo build && target/debug/prog -f filter1_option1
Actual Behaviour
Expected Behaviour
args: Args { filters: [filter1_option1] }
Additional Context
I get the Expected Behaviour when I flip things and invoke the program with a hyphen, like
target/debug/prog -f filter1-option1
. My domain users will be familiar with the underscore format so that's what I want to constrain them to and that's what matches options that my enum will match in other aspects of my full fledged program where I noticed this behaviour.Debug Output
The text was updated successfully, but these errors were encountered: