List of usage examples for org.apache.commons.cli OptionBuilder withDescription
public static OptionBuilder withDescription(String newDescription)
From source file:org.lilyproject.clientmetrics.postproc.MetricsReportTool.java
@Override @SuppressWarnings("static-access") public List<Option> getOptions() { List<Option> options = super.getOptions(); metricsFileOption = OptionBuilder.withArgName("filename").hasArg() .withDescription("Name of the input metrics file").withLongOpt("metrics-file").create("m"); options.add(metricsFileOption);/*from w w w . ja v a 2 s .co m*/ outputDirOption = OptionBuilder.withArgName("dirname").hasArg().withDescription("Name of the output dir") .withLongOpt("output-dir").create("o"); options.add(outputDirOption); forceOption = OptionBuilder.withDescription("Force using the output directory even if it already exists") .withLongOpt("force").create("f"); options.add(forceOption); return options; }
From source file:org.lilyproject.indexer.admin.cli.BaseIndexerAdminCli.java
public BaseIndexerAdminCli() { // Here we instantiate various options, but it is up to subclasses to decide which ones // they acutally want to use (see getOptions() method). forceOption = OptionBuilder.withDescription("Skips optional validations.").withLongOpt("force").create("f"); nameOption = OptionBuilder.withArgName("name").hasArg().withDescription("Index name.").withLongOpt("name") .create("n"); solrShardsOption = OptionBuilder.withArgName("solr-shards").hasArg() .withDescription("Comma separated list of 'shardname:URL' pairs pointing to SOLR instances.") .withLongOpt("solr-shards").create("s"); shardingConfigurationOption = OptionBuilder.withArgName("shardingconfig.json").hasArg() .withDescription("Sharding configuration.").withLongOpt("sharding-config").create("p"); configurationOption = OptionBuilder.withArgName("indexerconfig.xml").hasArg() .withDescription("Indexer configuration.").withLongOpt("indexer-config").create("c"); generalStateOption = OptionBuilder.withArgName("state").hasArg() .withDescription("General state, one of: " + IndexGeneralState.ACTIVE + ", " + IndexGeneralState.DISABLED + ", " + IndexGeneralState.DELETE_REQUESTED) .withLongOpt("state").create("i"); updateStateOption = OptionBuilder.withArgName("state").hasArg() .withDescription("Update state, one of: " + getStates(IndexUpdateState.values())) .withLongOpt("update-state").create("u"); buildStateOption = OptionBuilder.withArgName("state").hasArg() .withDescription("Build state, only: " + IndexBatchBuildState.BUILD_REQUESTED) .withLongOpt("build-state").create("b"); outputFileOption = OptionBuilder.withArgName("filename").hasArg().withDescription("Output file name") .withLongOpt("output-file").create("o"); }
From source file:org.lilyproject.lilyservertestfw.launcher.HadoopLauncherService.java
@Override public void addOptions(List<Option> options) { disableMROption = OptionBuilder.withDescription("Disable startup of MapReduce services") .withLongOpt("disable-map-reduce").create("dmr"); options.add(disableMROption);/*from w w w.ja v a2 s. com*/ }
From source file:org.lilyproject.lilyservertestfw.launcher.LilyLauncher.java
@Override @SuppressWarnings("static-access") public List<Option> getOptions() { List<Option> options = super.getOptions(); enableHadoopOption = OptionBuilder.withDescription("Start the Hadoop services (ZK/DFS/MR/HBase)") .withLongOpt("hadoop").create("hadoop"); options.add(enableHadoopOption);//ww w . j a v a 2 s.c o m enableSolrOption = OptionBuilder.withDescription("Start the Solr service").withLongOpt("solr") .create("solr"); options.add(enableSolrOption); enableLilyOption = OptionBuilder.withDescription("Start the Lily service").withLongOpt("lily") .create("lily"); options.add(enableLilyOption); enableHbaseIndexerOption = OptionBuilder.withDescription("Start the HBase Indexer Service") .withLongOpt("hbase-indexer").create("indexer"); dataDirOption = OptionBuilder .withDescription("Directory where data should be stored, instead of a temporary directory. " + "Can be used to restart from previous state.") .hasArg().withArgName("path").withLongOpt("data-dir").create("d"); options.add(dataDirOption); prepareOption = OptionBuilder .withDescription("Create a template data directory, this will allow faster startup " + "in the future (when not using -d)") .withLongOpt("prepare").create("p"); options.add(prepareOption); for (LauncherService service : allServices) { service.addOptions(options); } return options; }
From source file:org.lilyproject.lilyservertestfw.launcher.SolrLauncherService.java
@Override public void addOptions(List<Option> options) { schemaOption = OptionBuilder.withArgName("schema.xml").hasArg().withDescription("Solr schema file name") .withLongOpt("schema").create("s"); options.add(schemaOption);//from w w w . j av a 2 s. co m commitOption = OptionBuilder.withArgName("seconds").hasArg() .withDescription("Auto commit index within this amount of seconds (default: no auto commit)") .withLongOpt("commit").create("c"); options.add(commitOption); solrConfigOption = OptionBuilder.withArgName("solrconfig").hasArg() .withDescription("Custom solrconfig file").withLongOpt("solrconfig").create("sc"); options.add(solrConfigOption); solrCloudModeOption = OptionBuilder .withDescription("Use cloud mode (connect with ZooKeeper) when starting Solr.") .withLongOpt("solrcloud").create("solrcloud"); options.add(solrCloudModeOption); }
From source file:org.lilyproject.repository.bulk.AbstractBulkImportCliTool.java
@SuppressWarnings("static-access") public AbstractBulkImportCliTool() { pythonMapperPathArg = OptionBuilder.withDescription("Path to Python mapper file").withLongOpt("pyfile") .hasArg().create('p'); pythonSymbolArg = OptionBuilder.withDescription("Python mapper symbol").withLongOpt("symbol").hasArg() .create('s'); repositoryArg = OptionBuilder.withDescription("Repository name (defaults to default repository)") .withLongOpt("repository").hasArg().create('r'); outputTableArg = OptionBuilder.withDescription("Repository table name (defaults to record)") .withLongOpt("table").hasArg().create('t'); disableBulkOption = OptionBuilder.withDescription("disable bulk mode").withLongOpt("no_bulk").create('n'); }
From source file:org.lilyproject.repository.bulk.serial.BulkImportTool.java
@SuppressWarnings("static-access") @Override/*from ww w .j a v a2 s . c o m*/ public List<Option> getOptions() { dryRunOption = OptionBuilder .withDescription("Only print out the created records without writing them to Lily") .withLongOpt("dryrun").create('d'); List<Option> options = super.getOptions(); options.add(dryRunOption); return options; }
From source file:org.lilyproject.repository.cli.AddRepositoryCli.java
@Override @SuppressWarnings("static-access") public List<Option> getOptions() { List<Option> options = super.getOptions(); options.add(nameOption);//from w w w . j a v a 2 s.c om failIfExistsOption = OptionBuilder .withDescription("Fails if the repository already exists (process status code 1).") .withLongOpt("fail-if-exists").create(); options.add(failIfExistsOption); return options; }
From source file:org.lilyproject.repository.cli.BaseRepositoriesAdminCli.java
@SuppressWarnings("static-access") public BaseRepositoriesAdminCli() { nameOption = OptionBuilder.withArgName("name").hasArg().withDescription("Repository name.") .withLongOpt("name").create("n"); forceOption = OptionBuilder.withDescription("Skips optional validations.").withLongOpt("force").create("f"); }
From source file:org.lilyproject.repository.cli.DeleteRepositoryCli.java
@Override @SuppressWarnings("static-access") public List<Option> getOptions() { List<Option> options = super.getOptions(); options.add(nameOption);/*from w ww . ja v a 2 s.c o m*/ failIfNotExistsOption = OptionBuilder .withDescription("Fails if the repository did not exist (process status code 1).") .withLongOpt("fail-if-not-exists").create(); options.add(failIfNotExistsOption); return options; }