You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
CommandLine commandLine = new CommandLine(new App());
commandLine.parse(new String[0]);
System.out.println("Success!");
The code prints "Success!", but it should raise MissingParameterException. By a superficial debugging of the picocli code it seems that the method CommandLine.Parser.applyDefault(IDefaultValueProvider, ArgSpec, List<ArgSpec>) does not set the correct default value to the usage and version help options when the defaultValue attribute is present in the @Option annotation. Thus picocli behaves as if the two options were active. By removing the defaultValue attributes everything works correctly.
The text was updated successfully, but these errors were encountered:
Let us consider this situation:
and the code:
The code prints "Success!", but it should raise MissingParameterException. By a superficial debugging of the picocli code it seems that the method
CommandLine.Parser.applyDefault(IDefaultValueProvider, ArgSpec, List<ArgSpec>)
does not set the correct default value to the usage and version help options when thedefaultValue
attribute is present in the@Option
annotation. Thus picocli behaves as if the two options were active. By removing thedefaultValue
attributes everything works correctly.The text was updated successfully, but these errors were encountered: