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
publicstaticvoidmain(String[] args){
Stringmsg = ArgumentsParser.builder()
//Option with parameter values
.setOptions("-a","-b","-c","-d")
//Option without parameter values
.setOptionsWithoutValue("-k","-l","-m","-n")
//Separator between option and value
.setValueSeparator("=","")
//Command line arguments
.setArgs(args)
.build()
.check((argument)->{
//You can check each parameter item here, if it is not correct, you can throw an IllegalArgumentExceptionif (StringUtils.isEmpty(argument.getOption())){
System.out.println("argument:" + argument.getValue());
System.out.println("--------------------");
}
else{
System.out.println("option:" + argument.getOption());
System.out.println("value :" + argument.getValue());
System.out.println("--------------------");
}
})
.getIllegalArgumentMessage();
}