-
Notifications
You must be signed in to change notification settings - Fork 423
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
Error - Expected parameter for option when one option value starts with another option #2340
Comments
The picocli parser does not distinguish between You will need to do some custom processing. Please take a look at 11.15. Custom Parameter Processing in the user manual. |
I looked at the linked Quarkus issue and now I'm a bit confused. I thought the error would only occur when the user specified an exact option name as the value for another option, but it seems that the issue also occurs even if the value starts with an option name. Away from my PC now, I'll take another look. Meanwhile, before diving into Custom Processing, please check out this parser configuration option (11.9.2. Enable Consuming Option Names or Subcommands). |
Yes, correct. Sorry, I should have been more clear on that one. It does happen when the option value starts with another option. So: new CommandLine(new DashedOption()).execute(new String[]{"--required=-xabc"}); This will also fail.
Thanks. I'll have a look. |
Consider:
Output:
When one option value starts with another option it causes the error
Expected parameter for option '--required' but found '-x'
. Notice that it is perfectly fine to pass dashed values to a particular option value, but it fails if that value starts with another option.The text was updated successfully, but these errors were encountered: