import com.beust.jcommander.JCommander;
import com.beust.jcommander.Parameter;
import java.util.ArrayList;
import java.util.List;
public class Main2 {
public enum ChoiceType { ONE, TWO, THREE };
@Parameter(names = "-choice")
public ChoiceType choice = ChoiceType.ONE;
@Parameter(names = "-choices", variableArity = true)
public List<ChoiceType> choices = new ArrayList<ChoiceType>();
public static void main(String[] args1) {
Main2 args = new Main2();
String[] argv = { "-choice", "ONE"};
JCommander jc = new JCommander(args, argv);
jc.usage();
}
}
-------------
output:
-------------
Usage: <main class> [options]
Options:
-choice
Options: [ONE, Two, THREE]
Default: ONE
Possible Values: [ONE, Two, THREE]
-choices
Default: []
Is there an option I can set to make the possible values display for the "choices" variable, like it does for the "choice" variable?