cbeust / jcommander

Command line parsing framework for Java

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

cannot detected the required parameter if no value input

bglmmz opened this issue · comments

commented
..
 @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.