-
Notifications
You must be signed in to change notification settings - Fork 445
Closed
Labels
Milestone
Description
Bug reported in #284: positional parameters with arity = "*" (varargs) will greedily consume the remaining command line arguments, even arguments that are options. This does not follow the specification as described in the Mixing Options and Positional Parameters section of the user manual.
For example, this command:
class Cmd {
@Option(names = "--alpha") String alpha;
@Parameters(index = "0", arity = "1") String foo;
@Parameters(index = "1..*", arity = "*") List<String> params;
}
Given command line arguments like this:
<cmd> foo xx --alpha --beta
Expected result:
alpha = --beta
foo = foo
params = [xx]
Actual result:
cmd.foo == 'foo'
cmd.params == ['xx', '--alpha', '--beta']