-
Notifications
You must be signed in to change notification settings - Fork 18
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
one_of's are not exclusive #32
Comments
A reasonable workaround until this bug is fixed: die "The --foo, --bar and --baz options are mutually exclusive.\n" . $usage->text
if 1 < grep defined($opt->$_), qw(foo bar baz);
die "You must give exactly one of the --foo, --bar and --baz options.\n" . $usage->text
unless 1 == grep defined($opt->$_), qw(foo bar baz); |
@bpj I think you may have dropped these: ,, In all seriousness, it really looks better with the oxford comma:
|
@szr8 I guess I have some gut reaction against separating options with anything but space! 😃 The string has to be adapted to the needs/whims of the program/programmer anyway. The code works. |
I just stumbled over the same issue which seems to come from having a dash in the option name. |
Exclusive one of options are not throwing an error in some combinations.
Code below:
Example running and output:
Individually they show the correct behavior, set the $opt->mode.
But when combined in this case the top option
--ten-minute
never conflicts with the next two.The text was updated successfully, but these errors were encountered: