-
Notifications
You must be signed in to change notification settings - Fork 3
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
Conflicting options #11
Comments
Interestingly, those options in |
There's another possible design: #[arguments(
conflicts = [
(Foo, Bar)
]
)]
enum Arg {
#[arg("--foo", conflict_group="foobar")]
Foo,
#[arg("--bar", conflict_group="foobar")]
Bar,
} |
But there are some difficulties:
I wonder if there's some convenience function we can make for the |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It doesn't occur often in coreutils, but sometimes options conflict. They might even conflict with themselves. This is tricky to support while also maintaining good error messages.
One design could be to define conflict groups (leaving out some boilerplate in the example):
"foobar"
is a key into some hashset of options that have been set.An example of conflicting options are
cut
's--fields
,--bytes
and--characters
.The text was updated successfully, but these errors were encountered: