Java Code Examples for org.apache.commons.cli.OptionBuilder#hasArg()

The following examples show how to use org.apache.commons.cli.OptionBuilder#hasArg() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ApplicationArguments.java    From bigtable-sql with Apache License 2.0 5 votes vote down vote up
private Option createAnOptionWithArgument(String[] argInfo)
{
	OptionBuilder.withArgName(argInfo[0]);
	OptionBuilder.hasArg();
	OptionBuilder.withDescription(argInfo[2]);
	Option opt = OptionBuilder.create( argInfo[0]);
	if (!isStringEmpty(argInfo[1]))
	{
		opt.setLongOpt(argInfo[1]);
	}
	return opt;
}
 
Example 2
Source File: LinkDumper.java    From nutch-htmlunit with Apache License 2.0 5 votes vote down vote up
/**
 * Runs the LinkDumper tool.  This simply creates the database, to read the
 * values the nested Reader tool must be used.
 */
public int run(String[] args)
  throws Exception {

  Options options = new Options();
  OptionBuilder.withArgName("help");
  OptionBuilder.withDescription("show this help message");
  Option helpOpts = OptionBuilder.create("help");
  options.addOption(helpOpts);
  
  OptionBuilder.withArgName("webgraphdb");
  OptionBuilder.hasArg();
  OptionBuilder.withDescription("the web graph database to use");
  Option webGraphDbOpts = OptionBuilder.create("webgraphdb");
  options.addOption(webGraphDbOpts);
  
  CommandLineParser parser = new GnuParser();
  try {

    CommandLine line = parser.parse(options, args);
    if (line.hasOption("help") || !line.hasOption("webgraphdb")) {
      HelpFormatter formatter = new HelpFormatter();
      formatter.printHelp("LinkDumper", options);
      return -1;
    }

    String webGraphDb = line.getOptionValue("webgraphdb");
    dumpLinks(new Path(webGraphDb));
    return 0;
  }
  catch (Exception e) {
    LOG.error("LinkDumper: " + StringUtils.stringifyException(e));
    return -2;
  }
}
 
Example 3
Source File: LinkRank.java    From nutch-htmlunit with Apache License 2.0 5 votes vote down vote up
/**
 * Runs the LinkRank tool.
 */
public int run(String[] args)
  throws Exception {

  Options options = new Options();
  OptionBuilder.withArgName("help");
  OptionBuilder.withDescription("show this help message");
  Option helpOpts = OptionBuilder.create("help");
  options.addOption(helpOpts);
  
  OptionBuilder.withArgName("webgraphdb");
  OptionBuilder.hasArg();
  OptionBuilder.withDescription("the web graph db to use");
  Option webgraphOpts = OptionBuilder.create("webgraphdb");
  options.addOption(webgraphOpts);

  CommandLineParser parser = new GnuParser();
  try {

    CommandLine line = parser.parse(options, args);
    if (line.hasOption("help") || !line.hasOption("webgraphdb")) {
      HelpFormatter formatter = new HelpFormatter();
      formatter.printHelp("LinkRank", options);
      return -1;
    }

    String webGraphDb = line.getOptionValue("webgraphdb");

    analyze(new Path(webGraphDb));
    return 0;
  }
  catch (Exception e) {
    LOG.error("LinkAnalysis: " + StringUtils.stringifyException(e));
    return -2;
  }
}
 
Example 4
Source File: Server.java    From usergrid with Apache License 2.0 5 votes vote down vote up
static Options createOptions() {
    // the nogui option will be required due to combining the graphical
    // launcher with this standalone CLI based server
    Options options = new Options();
    OptionBuilder.withDescription( "Start launcher without UI" );
    OptionBuilder.isRequired( true );
    Option noguiOption = OptionBuilder.create( "nogui" );

    OptionBuilder.isRequired( false );
    OptionBuilder.withDescription( "Initialize database" );
    Option initOption = OptionBuilder.create( "init" );

    OptionBuilder.withDescription( "Start database" );
    Option dbOption = OptionBuilder.create( "db" );

    OptionBuilder.withDescription( "Http port (without UI)" );
    OptionBuilder.hasArg();
    OptionBuilder.withArgName( "PORT" );
    OptionBuilder.withLongOpt( "port" );
    OptionBuilder.withType( Number.class );
    Option portOption = OptionBuilder.create( 'p' );

    options.addOption( initOption );
    options.addOption( dbOption );
    options.addOption( portOption );
    options.addOption( noguiOption );

    return options;
}
 
Example 5
Source File: TaskomaticDaemon.java    From spacewalk with GNU General Public License v2.0 5 votes vote down vote up
private void createOption(Options accum, String longopt, boolean arg,
        String argName, String description) {
    OptionBuilder.withArgName(argName);
    OptionBuilder.withLongOpt(longopt);
    OptionBuilder.hasArg(arg);
    OptionBuilder.withDescription(description);
    Option option = OptionBuilder.create(longopt);
    accum.addOption(option);
    if (this.masterOptionsMap.get(longopt) == null) {
        this.masterOptionsMap.put(longopt, option);
    }
}
 
Example 6
Source File: TaskomaticDaemon.java    From uyuni with GNU General Public License v2.0 5 votes vote down vote up
private void createOption(Options accum, String longopt, boolean arg,
                          String argName, String description) {
    OptionBuilder.withArgName(argName);
    OptionBuilder.withLongOpt(longopt);
    OptionBuilder.hasArg(arg);
    OptionBuilder.withDescription(description);
    Option option = OptionBuilder.create(longopt);
    accum.addOption(option);
    if (this.masterOptionsMap.get(longopt) == null) {
        this.masterOptionsMap.put(longopt, option);
    }
}
 
Example 7
Source File: CliOption.java    From tracecompass with Eclipse Public License 2.0 5 votes vote down vote up
Option toCliOption() {
    OptionBuilder.withArgName(fArgumentName);
    // Number of arguments
    if (fMaxArguments == 0) {
        // No arguments
        OptionBuilder.hasArg(false);
    } else if (fMaxArguments == 1) {
        // 1 argument, optional or mandatory
        if (fMinArguments == 0) {
            OptionBuilder.hasOptionalArg();
        } else {
            OptionBuilder.hasArg();
        }
    } else if (fMaxArguments < Integer.MAX_VALUE) {
        // Many arguments, optional or mandatory
        if (fMinArguments == 0) {
            OptionBuilder.hasOptionalArgs(fMaxArguments);
        } else {
            OptionBuilder.hasArgs(fMaxArguments);
        }
    } else {
        // Unbounded number of optional or mandatory arguments
        if (fMinArguments == 0) {
            OptionBuilder.hasOptionalArgs();
        } else {
            OptionBuilder.hasArgs();
        }
    }
    if (fLongOption != null) {
        OptionBuilder.withLongOpt(fLongOption);
    }
    if (fDescription != null) {
        OptionBuilder.withDescription(fDescription);
    }
    return Objects.requireNonNull(OptionBuilder.create(fShortOption));
}
 
Example 8
Source File: Analyze.java    From ade with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Method to parse specific arguments for "Analyze".
 */
@Override
protected final void parseArgs(String[] args) throws AdeException {
    final Options options = new Options();

    OptionBuilder.withArgName(OPTION_SOURCES);
    OptionBuilder.withLongOpt(OPTION_SOURCES);
    OptionBuilder.isRequired(false);
    OptionBuilder.hasArg();
    OptionBuilder.withDescription("Specify the Source to be analyzed.  ");
    options.addOption(OptionBuilder.create("s"));

    super.parseArgs(options, args);

}
 
Example 9
Source File: Loops.java    From nutch-htmlunit with Apache License 2.0 5 votes vote down vote up
/**
 * Runs the Loops tool.
 */
public int run(String[] args)
  throws Exception {

  Options options = new Options();
  OptionBuilder.withArgName("help");
  OptionBuilder.withDescription("show this help message");
  Option helpOpts = OptionBuilder.create("help");
  options.addOption(helpOpts);
  
  OptionBuilder.withArgName("webgraphdb");
  OptionBuilder.hasArg();
  OptionBuilder.withDescription("the web graph database to use");
  Option webGraphDbOpts = OptionBuilder.create("webgraphdb");
  options.addOption(webGraphDbOpts);

  CommandLineParser parser = new GnuParser();
  try {

    CommandLine line = parser.parse(options, args);
    if (line.hasOption("help") || !line.hasOption("webgraphdb")) {
      HelpFormatter formatter = new HelpFormatter();
      formatter.printHelp("Loops", options);
      return -1;
    }

    String webGraphDb = line.getOptionValue("webgraphdb");
    findLoops(new Path(webGraphDb));
    return 0;
  }
  catch (Exception e) {
    LOG.error("Loops: " + StringUtils.stringifyException(e));
    return -2;
  }
}
 
Example 10
Source File: UpdateGroups.java    From ade with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Method for building the allowed options.
 * @param options Options object for adding the options created with OptionBuilder.
 */
private void buildOptions(Options options){        
    OptionBuilder.withArgName(OPTION_HELP);
    OptionBuilder.withLongOpt(OPTION_HELP);
    OptionBuilder.isRequired(false);
    OptionBuilder.withDescription("Print help message and exit.");
    options.addOption(OptionBuilder.create('h'));
    
    OptionBuilder.withArgName(OPTION_INPUT_JSON);
    OptionBuilder.withLongOpt(OPTION_INPUT_JSON);
    OptionBuilder.isRequired(false);
    OptionBuilder.hasArg();
    OptionBuilder.withDescription("Specify the JSON input file.");
    options.addOption(OptionBuilder.create("j"));
}
 
Example 11
Source File: AwAlerting.java    From adwords-alerting with Apache License 2.0 5 votes vote down vote up
/**
 * Creates the command line options.
 *
 * @return the {@link Options}
 */
private static Options createCommandLineOptions() {
  Options options = new Options();

  OptionBuilder.withArgName("help");
  OptionBuilder.hasArg(false);
  OptionBuilder.withDescription("print this message");
  OptionBuilder.isRequired(false);
  options.addOption(OptionBuilder.create("help"));

  OptionBuilder.withArgName("file");
  OptionBuilder.hasArg(true);
  OptionBuilder.withDescription("aw-report-alerting-sample.properties file.");
  OptionBuilder.isRequired(false);
  options.addOption(OptionBuilder.create("file"));

  OptionBuilder.withArgName("accountIdsFile");
  OptionBuilder.hasArg(true);
  OptionBuilder.withDescription(
      "Consider ONLY the account IDs specified on the file to run the report");
  OptionBuilder.isRequired(false);
  options.addOption(OptionBuilder.create("accountIdsFile"));

  OptionBuilder.withArgName("debug");
  OptionBuilder.hasArg(false);
  OptionBuilder.withDescription("Will display all the debug information. "
      + "If the option 'verbose' is activated, "
      + "all the information will be displayed on the console as well");
  OptionBuilder.isRequired(false);
  options.addOption(OptionBuilder.create("debug"));

  return options;
}
 
Example 12
Source File: Utils.java    From carmen with BSD 2-Clause "Simplified" License 5 votes vote down vote up
public static void registerOption(List<Option> options, String option_name, String arg_name, boolean has_arg, String description) {
	OptionBuilder.withArgName(arg_name);
	OptionBuilder.hasArg(has_arg);
	OptionBuilder.withDescription(description);
	Option option = OptionBuilder.create(option_name);
	
	options.add(option);		
}
 
Example 13
Source File: AddFind.java    From BiglyBT with GNU General Public License v2.0 5 votes vote down vote up
public AddFind()
{
	super("add", "a");

	OptionBuilder.withArgName("outputDir");
	OptionBuilder.withLongOpt("output");
	OptionBuilder.hasArg();
	OptionBuilder.withDescription("override default download directory");
	OptionBuilder.withType(File.class);
	getOptions().addOption( OptionBuilder.create('o') );
	getOptions().addOption("r", "recurse", false, "recurse sub-directories.");
	getOptions().addOption("f", "find", false, "only find files, don't add.");
	getOptions().addOption("h", "help", false, "display help about this command");
	getOptions().addOption("l", "list", false, "list previous find results");
}
 
Example 14
Source File: AdeExtOptions.java    From ade with GNU General Public License v3.0 4 votes vote down vote up
public static Options buildOptions(Options subClassOptions) {
    /* Add the options from subClass */
    Options options = new Options();
    for (Object subClassOption : subClassOptions.getOptions()) {
        Option option = (Option) subClassOption;
        options.addOption(option);
    }

    /* Add the general options */
    OptionBuilder.withArgName(OPTION_HELP);
    OptionBuilder.withLongOpt(OPTION_HELP);
    OptionBuilder.isRequired(false);
    OptionBuilder.withDescription("Print help message and exit");
    options.addOption(OptionBuilder.create('h'));

    OptionBuilder.withArgName(OPTION_INPUT_FILE);
    OptionBuilder.withLongOpt(OPTION_INPUT_FILE);
    OptionBuilder.hasArg();
    OptionBuilder.isRequired(false);
    OptionBuilder.withDescription("Input file name or 'stdin'");
    options.addOption(OptionBuilder.create('f'));

    OptionBuilder.withArgName(OPTION_INPUT_DIR);
    OptionBuilder.withLongOpt(OPTION_INPUT_DIR);
    OptionBuilder.hasArg();
    OptionBuilder.isRequired(false);
    OptionBuilder.withDescription("Input dir name");
    options.addOption(OptionBuilder.create('d'));

    OptionBuilder.withArgName(OPTION_SOURCES);
    OptionBuilder.withLongOpt(OPTION_SOURCES);
    OptionBuilder.hasArg();
    OptionBuilder.isRequired(false);
    OptionBuilder.withDescription("Source Names.");
    options.addOption(OptionBuilder.create('s'));

    OptionBuilder.withArgName(OPTION_OS_TYPE);
    OptionBuilder.withLongOpt(OPTION_OS_TYPE);
    OptionBuilder.hasArg();
    OptionBuilder.isRequired(false);
    OptionBuilder.withDescription("The OS Type."
            + "If this option is omitted, the default is Linux");
    options.addOption(OptionBuilder.create('o'));

    OptionBuilder.withArgName(OPTION_GMT_OFFSET);
    OptionBuilder.withLongOpt(OPTION_GMT_OFFSET);
    OptionBuilder.hasArg();
    OptionBuilder.isRequired(false);
    OptionBuilder.withDescription("hours offset from GMT");
    options.addOption(OptionBuilder.create('g'));

    return options;
}
 
Example 15
Source File: JMXGet.java    From RDFS with Apache License 2.0 4 votes vote down vote up
/**
 * parse args
 */
private static CommandLine parseArgs(Options opts, String ...args) 
throws IllegalArgumentException{

  OptionBuilder.withArgName("NameNode|DataNode");
  OptionBuilder.hasArg();
  OptionBuilder.withDescription("specify jmx service (NameNode by default)");
  Option jmx_service = OptionBuilder.create("service");

  OptionBuilder.withArgName("mbean server");
  OptionBuilder.hasArg();
  OptionBuilder.withDescription("specify mbean server (localhost by default)");
  Option jmx_server = OptionBuilder.create("server");

  OptionBuilder.withDescription("print help");
  Option jmx_help = OptionBuilder.create("help");

  OptionBuilder.withArgName("mbean server port");
  OptionBuilder.hasArg();
  OptionBuilder.withDescription("specify mbean server port, " +
  "if missing - it will try to connect to MBean Server in the same VM");
  Option jmx_port = OptionBuilder.create("port");

  OptionBuilder.withArgName("VM's pid");
  OptionBuilder.hasArg();
  OptionBuilder.withDescription("connect to the VM on the same machine");
  Option jmx_localVM = OptionBuilder.create("localVM");

  opts.addOption(jmx_server);
  opts.addOption(jmx_help);
  opts.addOption(jmx_service);
  opts.addOption(jmx_port);
  opts.addOption(jmx_localVM);

  CommandLine commandLine=null;
  CommandLineParser parser = new GnuParser();
  try {
    commandLine = parser.parse(opts, args, true);
  } catch(ParseException e) {
    printUsage(opts);
    throw new IllegalArgumentException("invalid args: " + e.getMessage()); 
  }
  return commandLine;
}
 
Example 16
Source File: ResolveUrls.java    From nutch-htmlunit with Apache License 2.0 4 votes vote down vote up
/**
 * Runs the resolve urls tool.
 */
public static void main(String[] args) {

  Options options = new Options();
  OptionBuilder.withArgName("help");
  OptionBuilder.withDescription("show this help message");
  Option helpOpts = OptionBuilder.create("help");
  options.addOption(helpOpts);
  
  OptionBuilder.withArgName("urls");
  OptionBuilder.hasArg();
  OptionBuilder.withDescription("the urls file to check");
  Option urlOpts = OptionBuilder.create("urls");
  options.addOption(urlOpts);
  
  OptionBuilder.withArgName("numThreads");
  OptionBuilder.hasArgs();
  OptionBuilder.withDescription("the number of threads to use");
  Option numThreadOpts = OptionBuilder.create("numThreads");
  options.addOption(numThreadOpts);

  CommandLineParser parser = new GnuParser();
  try {
    // parse out common line arguments
    CommandLine line = parser.parse(options, args);
    if (line.hasOption("help") || !line.hasOption("urls")) {
      HelpFormatter formatter = new HelpFormatter();
      formatter.printHelp("ResolveUrls", options);
      return;
    }

    // get the urls and the number of threads and start the resolver
    String urls = line.getOptionValue("urls");
    int numThreads = 100;
    String numThreadsStr = line.getOptionValue("numThreads");
    if (numThreadsStr != null) {
      numThreads = Integer.parseInt(numThreadsStr);
    }
    ResolveUrls resolve = new ResolveUrls(urls, numThreads);
    resolve.resolveUrls();
  }
  catch (Exception e) {
    LOG.error("ResolveUrls: " + StringUtils.stringifyException(e));
  }
}
 
Example 17
Source File: LoopReader.java    From nutch-htmlunit with Apache License 2.0 4 votes vote down vote up
/**
 * Runs the LoopReader tool.  For this tool to work the loops job must have
 * already been run on the corresponding WebGraph.
 */
public static void main(String[] args)
  throws Exception {

  Options options = new Options();
  OptionBuilder.withArgName("help");
  OptionBuilder.withDescription("show this help message");
  Option helpOpts = OptionBuilder.create("help");
  options.addOption(helpOpts);
  
  OptionBuilder.withArgName("webgraphdb");
  OptionBuilder.hasArg();
  OptionBuilder.withDescription("the webgraphdb to use");
  Option webGraphOpts = OptionBuilder.create("webgraphdb");
  options.addOption(webGraphOpts);
  
  OptionBuilder.withArgName("url");
  OptionBuilder.hasOptionalArg();
  OptionBuilder.withDescription("the url to dump");
  Option urlOpts = OptionBuilder.create("url");
  options.addOption(urlOpts);

  CommandLineParser parser = new GnuParser();
  try {

    CommandLine line = parser.parse(options, args);
    if (line.hasOption("help") || !line.hasOption("webgraphdb")
      || !line.hasOption("url")) {
      HelpFormatter formatter = new HelpFormatter();
      formatter.printHelp("WebGraphReader", options);
      return;
    }

    String webGraphDb = line.getOptionValue("webgraphdb");
    String url = line.getOptionValue("url");
    LoopReader reader = new LoopReader(NutchConfiguration.create());
    reader.dumpUrl(new Path(webGraphDb), url);
    return;
  }
  catch (Exception e) {
    e.printStackTrace();
    return;
  }
}
 
Example 18
Source File: ScoreUpdater.java    From nutch-htmlunit with Apache License 2.0 4 votes vote down vote up
/**
 * Runs the ScoreUpdater tool.
 */
public int run(String[] args)
  throws Exception {

  Options options = new Options();
  OptionBuilder.withArgName("help");
  OptionBuilder.withDescription("show this help message");
  Option helpOpts = OptionBuilder.create("help");
  options.addOption(helpOpts);
  
  OptionBuilder.withArgName("crawldb");
  OptionBuilder.hasArg();
  OptionBuilder.withDescription("the crawldb to use");
  Option crawlDbOpts = OptionBuilder.create("crawldb");
  options.addOption(crawlDbOpts);
  
  OptionBuilder.withArgName("webgraphdb");
  OptionBuilder.hasArg();
  OptionBuilder.withDescription("the webgraphdb to use");
  Option webGraphOpts = OptionBuilder.create("webgraphdb");
  options.addOption(webGraphOpts);

  CommandLineParser parser = new GnuParser();
  try {

    CommandLine line = parser.parse(options, args);
    if (line.hasOption("help") || !line.hasOption("webgraphdb")
      || !line.hasOption("crawldb")) {
      HelpFormatter formatter = new HelpFormatter();
      formatter.printHelp("ScoreUpdater", options);
      return -1;
    }

    String crawlDb = line.getOptionValue("crawldb");
    String webGraphDb = line.getOptionValue("webgraphdb");
    update(new Path(crawlDb), new Path(webGraphDb));
    return 0;
  }
  catch (Exception e) {
    LOG.error("ScoreUpdater: " + StringUtils.stringifyException(e));
    return -1;
  }
}
 
Example 19
Source File: NodeReader.java    From nutch-htmlunit with Apache License 2.0 4 votes vote down vote up
/**
 * Runs the NodeReader tool.  The command line arguments must contain a 
 * webgraphdb path and a url.  The url must match the normalized url that is
 * contained in the NodeDb of the WebGraph.
 */
public static void main(String[] args)
  throws Exception {

  Options options = new Options();
  OptionBuilder.withArgName("help");
  OptionBuilder.withDescription("show this help message");
  Option helpOpts = OptionBuilder.create("help");
  options.addOption(helpOpts);
  
  OptionBuilder.withArgName("webgraphdb");
  OptionBuilder.hasArg();
  OptionBuilder.withDescription("the webgraphdb to use");
  Option webGraphOpts = OptionBuilder.create("webgraphdb");
  options.addOption(webGraphOpts);
  
  OptionBuilder.withArgName("url");
  OptionBuilder.hasOptionalArg();
  OptionBuilder.withDescription("the url to dump");
  Option urlOpts = OptionBuilder.create("url");
  options.addOption(urlOpts);

  CommandLineParser parser = new GnuParser();
  try {

    // command line must take a webgraphdb and a url
    CommandLine line = parser.parse(options, args);
    if (line.hasOption("help") || !line.hasOption("webgraphdb")
      || !line.hasOption("url")) {
      HelpFormatter formatter = new HelpFormatter();
      formatter.printHelp("WebGraphReader", options);
      return;
    }

    // dump the values to system out and return
    String webGraphDb = line.getOptionValue("webgraphdb");
    String url = line.getOptionValue("url");
    NodeReader reader = new NodeReader(NutchConfiguration.create());
    reader.dumpUrl(new Path(webGraphDb), url);
    
    return;
  }
  catch (Exception e) {
    e.printStackTrace();
    return;
  }
}
 
Example 20
Source File: JMXGet.java    From hadoop with Apache License 2.0 4 votes vote down vote up
/**
 * parse args
 */
private static CommandLine parseArgs(Options opts, String... args)
throws IllegalArgumentException {

  OptionBuilder.withArgName("NameNode|DataNode");
  OptionBuilder.hasArg();
  OptionBuilder.withDescription("specify jmx service (NameNode by default)");
  Option jmx_service = OptionBuilder.create("service");

  OptionBuilder.withArgName("mbean server");
  OptionBuilder.hasArg();
  OptionBuilder
  .withDescription("specify mbean server (localhost by default)");
  Option jmx_server = OptionBuilder.create("server");

  OptionBuilder.withDescription("print help");
  Option jmx_help = OptionBuilder.create("help");

  OptionBuilder.withArgName("mbean server port");
  OptionBuilder.hasArg();
  OptionBuilder.withDescription("specify mbean server port, "
      + "if missing - it will try to connect to MBean Server in the same VM");
  Option jmx_port = OptionBuilder.create("port");

  OptionBuilder.withArgName("VM's connector url");
  OptionBuilder.hasArg();
  OptionBuilder.withDescription("connect to the VM on the same machine;"
      + "\n use:\n jstat -J-Djstat.showUnsupported=true -snap <vmpid> | "
      + "grep sun.management.JMXConnectorServer.address\n "
      + "to find the url");
  Option jmx_localVM = OptionBuilder.create("localVM");

  opts.addOption(jmx_server);
  opts.addOption(jmx_help);
  opts.addOption(jmx_service);
  opts.addOption(jmx_port);
  opts.addOption(jmx_localVM);

  CommandLine commandLine = null;
  CommandLineParser parser = new GnuParser();
  try {
    commandLine = parser.parse(opts, args, true);
  } catch (ParseException e) {
    printUsage(opts);
    throw new IllegalArgumentException("invalid args: " + e.getMessage());
  }
  return commandLine;
}