Example usage for org.apache.commons.cli OptionBuilder withDescription

List of usage examples for org.apache.commons.cli OptionBuilder withDescription

Introduction

In this page you can find the example usage for org.apache.commons.cli OptionBuilder withDescription.

Prototype

public static OptionBuilder withDescription(String newDescription) 

Source Link

Document

The next Option created will have the specified description

Usage

From source file:net.alegen.datpass.cli.input.ProfileCommand.java

protected ProfileCommand() {
    this.options = new Options();
    Option list = OptionBuilder.withDescription("list all existing profiles").withLongOpt(OPTION_LIST_LONG)
            .create(OPTION_LIST);/*from  w ww  . j a  v  a  2  s  .  c  o  m*/
    Option create = OptionBuilder.withDescription("create a new profile").withLongOpt(OPTION_CREATE_LONG)
            .create(OPTION_CREATE);
    Option remove = OptionBuilder.hasArg().withArgName("name")
            .withDescription("remove an existing profile with the given name").withLongOpt(OPTION_REMOVE_LONG)
            .create(OPTION_REMOVE);
    Option unlock = OptionBuilder.hasArg().withArgName("name")
            .withDescription("unlock and load an existing profile with the given name")
            .withLongOpt(OPTION_UNLOCK_LONG).create(OPTION_UNLOCK);
    Option encrypted = OptionBuilder.withDescription("unlock and load an existing profile with the given name")
            .withLongOpt(OPTION_ENCRYPTED_LONG).create(OPTION_ENCRYPTED);
    this.options.addOption(list);
    this.options.addOption(create);
    this.options.addOption(remove);
    this.options.addOption(unlock);
    this.options.addOption(encrypted);
}

From source file:guru.nidi.ftpsync.Config.java

private static Options createOptions() {
    final Options options = new Options();
    options.addOption(OptionBuilder.withDescription("The password").isRequired(false).withArgName("password")
            .hasArg(true).create('p'));
    options.addOption(OptionBuilder.withDescription("The private key").isRequired(false)
            .withArgName("private key").hasArg(true).create('i'));
    options.addOption(OptionBuilder.withDescription("If SFTP should be used").isRequired(false)
            .withArgName("sftp").hasArg(false).create('s'));
    options.addOption(//from www.  jav a 2 s.com
            OptionBuilder.withDescription("Force remote analysis").isRequired(false).hasArg(false).create('f'));
    return options;
}

From source file:com.hortonworks.pso.data.generator.mapreduce.DataGenTool.java

private void buildOptions() {
    options = new Options();
    Option help = OptionBuilder.withDescription("This help").create("help");
    Option mappers = OptionBuilder.withArgName("mappers").hasArg().withDescription("parallelism")
            .create("mappers");
    Option sink = OptionBuilder.withArgName("sink").hasArg()
            .withDescription("Target Sink: (HDFS|KAFKA) default-HDFS").create("sink");
    Option outputDir = OptionBuilder.withArgName("output").hasArg().withDescription(
            "Sink output information. HDFS-Output Directory or Kafka-URL: kafka://<kafka host>/<topic> OR kafka://kafka-server:9000,kafka-server2:9000/foobar")
            .create("output");
    Option config = OptionBuilder.withArgName("json config").hasArg().withDescription("control file")
            .create("jsonCfg");
    Option count = OptionBuilder.withArgName("count").hasArg().withDescription("total record count")
            .create("count");
    options.addOption(help);//from   www  . j  a va  2s.  co m
    options.addOption(mappers);
    options.addOption(sink);
    options.addOption(outputDir);
    options.addOption(config);
    options.addOption(count);
}

From source file:com.muni.fi.pa165.survive.rest.client.utils.OptionsProvider.java

public Options getOptions() {
    if (options != null) {
        return OptionsProvider.options;
    }//w w  w .  j  a  v  a 2s  . co m

    options = new Options();

    Option help = new Option("h", "Print help");

    Option operation = OptionBuilder.withArgName("operation").hasArg()
            .withDescription("operation, C, R, U, D, A").create("o");

    Option id = OptionBuilder.withArgName("id").hasArg().withDescription("Entity ID").create("i");

    Option name = OptionBuilder.withArgName("name").hasArg()
            .withDescription("name of an entity of a choosen mode").create("n");

    // WEAPON
    Option weapon = OptionBuilder.withDescription("Weapon Management").create("w");

    Option caliber = OptionBuilder.withArgName("caliber").hasArg().withDescription("Weapon ammo caliber (mm)")
            .create("m");
    Option range = OptionBuilder.withArgName("range").hasArg().withDescription("Weapon range in meters")
            .create("g");
    Option rounds = OptionBuilder.withArgName("rounds").hasArg()
            .withDescription("Number of rounds a weapon holds").create("r");
    Option weaponType = OptionBuilder.withArgName("Weapon Type").hasArg()
            .withDescription("Weapon Type: " + WeaponType.getList()).create("t");

    Option weaponClass = OptionBuilder.withArgName("Weapon Class").hasArg()
            .withDescription("Weapon Class: " + WeaponClass.getList()).create("c");

    //AREA
    Option area = OptionBuilder.withDescription("Area Management").create("a");

    Option description = OptionBuilder.withArgName("Description").hasArg().withDescription("Area description")
            .create("d");

    Option terrain = OptionBuilder.withArgName("Area Terrain").hasArg()
            .withDescription("Terrain Type: " + TerrainType.getList()).create("q");

    options.addOption(help);
    options.addOption(weaponType);
    options.addOption(weaponClass);
    options.addOption(rounds);
    options.addOption(weapon);
    options.addOption(area);
    options.addOption(operation);
    options.addOption(id);
    options.addOption(name);
    options.addOption(caliber);
    options.addOption(range);
    options.addOption(description);
    options.addOption(terrain);

    return options;

}

From source file:chibi.gemmaanalysis.cli.deprecated.StringVectorCleanup.java

@SuppressWarnings("static-access")
@Override// w ww  . j av  a  2 s.  co  m
protected void buildOptions() {
    super.buildOptions();
    this.addOption(OptionBuilder
            .withDescription("Examine ALL vectors for correct sizes, "
                    + "not just string types. Slow but useful check of the integrity of the system")
            .create('f'));
}

From source file:jlite.cli.JobStatus.java

private static Options setupOptions() {
    Options options = new Options();

    options.addOption(OptionBuilder.withDescription("displays usage").create("help"));

    options.addOption(OptionBuilder.withArgName("file_path")
            .withDescription("select JobId(s) from the specified file").hasArg().create("i"));

    options.addOption(OptionBuilder.withArgName("proxyfile")
            .withDescription("non-standard location of proxy cert").hasArg().create("proxypath"));

    options.addOption(OptionBuilder.withArgName("xml").withDescription("output as xml").create("xml"));

    //        options.addOption(OptionBuilder
    //              .withArgName("level")
    //                .withDescription("sets verbosity level of displayed information")
    //                .hasArg()
    //                .create("v"));

    return options;
}

From source file:eu.stratosphere.myriad.driver.MyriadDriverFrontend.java

public MyriadDriverFrontend() {
    // dgen-install-dir
    this.options = new Options();

    // scaling-factor
    OptionBuilder.hasArg();//from  w ww . j  a v  a2 s  . com
    OptionBuilder.withArgName("double");
    OptionBuilder.withDescription("scaling factor (s=1 generates 1GB)");
    OptionBuilder.withLongOpt("scaling-factor");
    this.options.addOption(OptionBuilder.create('s'));

    // dataset-id
    OptionBuilder.hasArg();
    OptionBuilder.withArgName("string");
    OptionBuilder.withDescription("ID of the generated Myriad dataset");
    OptionBuilder.withLongOpt("dataset-id");
    this.options.addOption(OptionBuilder.create('m'));

    // node-count
    OptionBuilder.hasArg();
    OptionBuilder.withArgName("int");
    OptionBuilder.withDescription("degree of parallelism (i.e. total number of partitions)");
    OptionBuilder.withArgName("node-count");
    this.options.addOption(OptionBuilder.create('N'));

    // output-base
    OptionBuilder.hasArg();
    OptionBuilder.withArgName("path");
    OptionBuilder.withDescription("base path for writing the output");
    OptionBuilder.withLongOpt("output-base");
    this.options.addOption(OptionBuilder.create('o'));

    // execute-stages
    OptionBuilder.hasArgs();
    OptionBuilder.withArgName("stagename");
    OptionBuilder.withDescription("specify specific stages to be executed");
    OptionBuilder.withLongOpt("execute-stage");
    this.options.addOption(OptionBuilder.create('x'));
}

From source file:com.dm.estore.server.CommandLineOptions.java

private Option createOption(final String argument, final String description, final String option) {
    OptionBuilder.withArgName(argument);
    OptionBuilder.hasArg();/*  w w w .  ja v  a2s.co  m*/
    OptionBuilder.withDescription(description);
    return OptionBuilder.create(option);
}

From source file:com.indeed.imhotep.index.builder.util.EasyIndexBuilderOptions.java

@Override
protected void setup() {
    description = "builds index shard for specified time range\n"
            + "start and end must be in yyyy-MM-dd HH:mm:ss format, but mins and secs will be truncated.\n"
            + "DO quote start and end";

    examples = "-o /var/ramses/tmp/indexname -r odin:9091 --start \"2009-06-16 09:00:00\" --end \"2009-06-16 12:00:00\"";

    options.addOption(OptionBuilder.isRequired().withArgName("YYYY-MM-DD HH:MM:SS")
            .withDescription("start time for processing, can be milliseconds").hasArg().withLongOpt("start")
            .create());/*ww w .j a v  a2 s  .com*/
    options.addOption(OptionBuilder.isRequired().withArgName("YYYY-MM-DD HH:MM:SS")
            .withDescription("end time for processing, can be milliseconds").hasArg().withLongOpt("end")
            .create());
    options.addOption(OptionBuilder.isRequired().withArgName("dir").withDescription("output directory").hasArg()
            .withLongOpt("output").create("o"));
    options.addOption(OptionBuilder.withArgName("args").withDescription("additional arguments").hasArg()
            .withLongOpt("extra").create("e"));

    options.addOption(
            OptionBuilder.withDescription("clear this segment if it exists").withLongOpt("overwrite").create());
    options.addOption(
            OptionBuilder.withDescription("exit without error if logs exist").withLongOpt("skip").create());
}

From source file:cz.muni.fi.pa165.creatures.rest.client.utils.OptionsProvider.java

public Options getOptions() {
    if (options != null) {
        return OptionsProvider.options;
    }//w  w w  .j  a  va  2s .  c o  m

    OptionsProvider.options = new Options();

    Option help = new Option("h", "prints this help");

    Option uri = OptionBuilder.withArgName("uri").hasArg().withDescription("uri of the resource we query")
            .create("u");

    Option operation = OptionBuilder.withArgName("operation").hasArg()
            .withDescription("operation, C, R, U, D, A or N").create("o");

    Option idOfEntity = OptionBuilder.withArgName("id").hasArg().withDescription("id of an entity to deal with")
            .create("i");

    Option name = OptionBuilder.withArgName("name").hasArg()
            .withDescription("name of an entity of a choosen mode").create("n");

    // WEAPON
    Option weapon = OptionBuilder.withDescription("weapon mode").create("w");

    Option ammunition = OptionBuilder.withArgName("ammunition").hasArg()
            .withDescription("ammunition of a weapon in bullets").create("m");

    Option range = OptionBuilder.withArgName("range").hasArg().withDescription("range of a weapon in meters")
            .create("g");

    // REGION
    Option region = OptionBuilder.withDescription("region mode").create("r");

    Option description = OptionBuilder.withArgName("description").hasArg()
            .withDescription("description of a region").create("d");

    Option area = OptionBuilder.withArgName("area").hasArg()
            .withDescription("area of region in square kilometers").create("a");

    options.addOption(help);
    options.addOption(uri);
    options.addOption(weapon);
    options.addOption(region);
    options.addOption(operation);
    options.addOption(idOfEntity);
    options.addOption(name);
    options.addOption(ammunition);
    options.addOption(range);
    options.addOption(description);
    options.addOption(area);

    return OptionsProvider.options;

}