-
Notifications
You must be signed in to change notification settings - Fork 445
Description
I use picocli and entered an undefined short option like e.g. '-x' on the command line as the first argument
in the list like so:
-x -v -g abc def
This short option is not defined in the @Options/@parameter definition. When running, it confused the interpreter such, that none of the following command line arguments is parsed correctly anymore. No UnmatchedArgumentException is thrown!
I guess, I found the reason. In line 1330 of CommandLine.java there is a check of the length of the argument:
else if (arg.length() > 2 && arg.startsWith("-")) {
I my case the arg length is 2 and therefore it is not recognized as a short option. As a consequence the positional parameter processing is entered.
I changed the line such:
else if (arg.length() >= 2 && arg.startsWith("-")) {
and now it seems to work properly