jcommander
jcommander copied to clipboard
cannot detected the required parameter if no value input
..
@Parameter(
names = {"--name"},
arity = 1,
required = true)
private String name;
@Parameter(
names = {"--class"},
arity = 1,
required = true)
private String class;
...
the command line is:
MyTest add --name --class one
the error message is:
command 'add' not support option 'one'
but not the expected:
option 'name' cannot be empty
but if the command line is:
MyTest add --class one --name
the error message is expected.