-
Notifications
You must be signed in to change notification settings - Fork 441
Closed
Labels
Milestone
Description
I'm running the code below (assertions enabled):
package test;
import picocli.CommandLine;
import picocli.CommandLine.ArgGroup;
import picocli.CommandLine.Command;
import picocli.CommandLine.Option;
public class ArgGroupsTest {
public static void main(String[] args) {
CommandLine cmd = new CommandLine(new TestCommand());
cmd.execute();
}
@Command(name = "ArgGroupsTest")
static class TestCommand implements Runnable {
@ArgGroup( exclusive = false)
DataSource datasource;
static class DataSource {
@Option(names = "-x", arity = "0..1", defaultValue = "999", fallbackValue = "-88" )
static int x;
}
@Override
public void run() {
assert TestCommand.DataSource.x== 999;
System.out.printf("x = %s%n", TestCommand.DataSource.x);
}
}
}
Since x = 0
, I'm getting:
Exception in thread "main" java.lang.AssertionError
at test.ArgGroupsTest$TestCommand.run(ArgGroupsTest.java:28)
...
Is this the intended behaviour?