conflicts_with_all ist accepts unacceptable entry and runtime panics #5462
Closed
thingsiplay
started this conversation in
Ideas
Replies: 1 comment
-
|
This is not a bug. The derive does not have all of the information it needs to properly error for this at compile time because a derive can only process the current struct and not any See also |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I start a discussion, because I don't know if this is a bug or not. At the moment, I am in the process of upgrading some older dependencies in my CLI app. One of them is clap v3.2 to v4.5 (using derive). While doing so I noticed that with option conflicts including a
-dash in the list will happily be accepted by clap. But that is clearly wrong and needs to be an_underscore. Rust compiles this and running the app will crash with a panic.I asked this in the Rust Discord and got the answer this is not a responsibility of Rust compiler itself, but maybe a bug in clap. Therefore before making an Issue, I would like to ask you guys if this is a bug or not.
I have two options
configandopen-config, which are mutual exclusive via the configuration:In clap 3 this worked fine, but with clap 4 I get following error message at runtime:
This is solved by replacing the dash with the underscore:
So either Rust or clap made a mistake to accept the unacceptable list entry with the dash. What do you guys think?
Beta Was this translation helpful? Give feedback.
All reactions