I have a parameter that I need to parse from the command line. I use arg4j version 2.0.23 for this. I need to analyze the path parameter, and one or more paths can be specified on the command line. Therefore, I need to parse several parameters. Here is how I find:
private List<String> list = new ArrayList<String>();
@Option(name = "-p", required = true)
public void addPath(String arg) {list.add(arg);}
It is working fine. But I want to know if this is right or is there a better way? I googled that in version 2.0.13 there was a multipleValue parameter in @Option, but now it has disappeared.
source
share