List of usage examples for org.apache.commons.cli2 CommandLine getSwitch
Boolean getSwitch(final Option option);
From source file:de.tu_chemnitz.mi.barcd.app.CommandLineArgumentsParser.java
/** * @param args the arguments as passed to a main function * * @return the parsed options, null if the arguments could no be parsed *///from w w w . java 2s.c om public Options parse(String[] args) { CommandLine commandLine = parser.parseAndHelp(args); if (commandLine == null) { return null; } Options options = new Options(); options.setJobFile((File) commandLine.getValue("--job")); options.setXmlSchemaUrl((URL) commandLine.getValue("--xml-schema")); options.setDisplay(commandLine.getSwitch("+display")); options.setPersist(commandLine.getSwitch("+persist")); return options; }