-
-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Arguments with default values conflict even if not used #1605
Comments
CreepySkeleton
added a commit
that referenced
this issue
Apr 26, 2020
CreepySkeleton
added a commit
that referenced
this issue
Apr 26, 2020
2 tasks
4 tasks
If I understand the history of this ticket correctly, the bug is still present in the latest stable release, which is Just asking because it seems that I just ran into it using clap 2.33.3. |
Yes. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Attention: This is directly related to #1071
The original issue was already marked as fixed but it seems like the bug was not fully eliminated.
Rust Version
Affected Version of clap
Expected Behavior Summary
I expect conflicts to happen only when conflicting arguments are explicitly present on the command line.
Actual Behavior Summary
As mentioned in #1071 originally it was enough for an argument to have a
default_value
configured to cause a conflict. This was fixed with 58b5b4b but it seems like the fix only applied to cases wheredefaults
andconflicts_with
are present on different arguments. Asconflicts_with
automatically applies to both related arguments it is also possible to apply the option the argument with thedefault
option.This again triggers the same error message as the original issue.
Sample Code or Link to Sample Code
https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=9913e0f7a7905f7be0131ae53ef4ec63
The text was updated successfully, but these errors were encountered: