List of usage examples for org.apache.commons.cli Option getValues
public String[] getValues()
From source file:ro.cs.products.Executor.java
private static void printCommandLine(CommandLine cmd) { Logger.getRootLogger().debug("Executing with the following arguments:"); for (Option option : cmd.getOptions()) { if (option.hasArgs()) { Logger.getRootLogger().debug(option.getOpt() + "=" + String.join(" ", option.getValues())); } else if (option.hasArg()) { Logger.getRootLogger().debug(option.getOpt() + "=" + option.getValue()); } else {// www .ja v a 2s . co m Logger.getRootLogger().debug(option.getOpt()); } } }
From source file:ru.xxlabaza.popa.Main.java
@Override public void run(String... args) throws Exception { val commandLine = parseArguments(args); for (Option option : commandLine.getOptions()) { commandsMap.get(option).execute(option.getValues()); }/*ww w . ja v a 2s. co m*/ // exit(0); }