Skip to content
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

Forbid args to conflict with themselves #1743

Closed
matthiaskrgr opened this issue Mar 13, 2020 · 1 comment · Fixed by #1797
Closed

Forbid args to conflict with themselves #1743

matthiaskrgr opened this issue Mar 13, 2020 · 1 comment · Fixed by #1797
Labels
C-enhancement Category: Raise on the bar on expectations
Milestone

Comments

@matthiaskrgr
Copy link
Contributor

I just found something like this in my code
Arg::with_name("a").conflicts_with("a")
This makes it impossible to use a because it will always cause an error.
I wonder if we could have some kind of warning put out if an arg conflicts with itself (preferably at buildtime, but I'm not sure if this can be done yet).

clap 2.33.0

@CreepySkeleton
Copy link
Contributor

It's impossible to issue warnings depending on certain conditions, but we can panic in this case.

@CreepySkeleton CreepySkeleton changed the title warn if arg conflicts with itself Forbid args to conflict with themselves Mar 13, 2020
@pksunkara pksunkara added this to the 3.0 milestone Apr 9, 2020
@pksunkara pksunkara linked a pull request Apr 9, 2020 that will close this issue
@pksunkara pksunkara added the C-enhancement Category: Raise on the bar on expectations label Apr 9, 2020
@bors bors bot closed this as completed in #1797 Apr 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-enhancement Category: Raise on the bar on expectations
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants