-
Notifications
You must be signed in to change notification settings - Fork 418
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
Long boolean options with arity 0 still allow parameters. #509
Comments
I can see this is inconsistent, thanks for raising it. I’ll take a look. |
I assumed that people would only specify arity for boolean options to optionally allow a parameter (as in Here is what currently happens:
At the moment, picocli does not distinguish between an omitted arity and an explicitly specified Still looking at how to fix this. |
I have a potential solution that involves keeping track of whether the arity was explicitly specified in the option definition. This test now passes:
Still checking for regressions... |
Fixed in master. Is this a critical issue for you? (That is, do you need a 3.6.2 release for this, or can it wait a few weeks for the 3.7 release?) |
@remkop Thanks for the quick-fix. I can wait till 3.7 since I have interm a work-around (throw if value = false). |
Given a option definition:
This still allows
--no-global-labels=false
.For non-boolean long options
arity = "0"
probably doesn't make sense. But for options like this it'd be nice to have picocli enforce the arity rather than have to check the boolean parameter and throw an exception if itsfalse
.The text was updated successfully, but these errors were encountered: