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:org.obiba.genobyte.cli.ReportCommand.java

public Option getOption() {
    StringBuilder sb = new StringBuilder();
    for (ReportProducer report : reports_) {
        if (sb.length() > 0)
            sb.append(", ");
        sb.append(report.getReportType());
    }/*from   w w  w .j a v  a2s .co  m*/
    return OptionBuilder.withDescription(
            "generates a report of type <type> and output to <filename> (use - for console output). Report parameters depend on its type. Available types are ["
                    + sb.toString() + "]")
            .withLongOpt("report").hasArgs().withArgName("type> <filename> <parameters").create();
}

From source file:org.obiba.genobyte.cli.StatsCommand.java

public Option getOption() {
    return OptionBuilder.withDescription("compute the store's statistics").withLongOpt("stats").create('t');
}

From source file:org.obiba.genobyte.cli.SwitchCommand.java

public Option getOption() {
    return OptionBuilder.withDescription("switch current active store").withLongOpt("switch").create('s');
}

From source file:org.obiba.illumina.bitwise.client.CreateStoreCommand.java

public Option getOption() {
    return OptionBuilder.withDescription("create a new store for infinium data").withLongOpt("create").hasArg()
            .withArgName("name").create('n');
}

From source file:org.obiba.illumina.bitwise.client.TransposeGenotypesCommand.java

public Option getOption() {
    return OptionBuilder.withDescription("transpose sample genotypes into the assay matrix")
            .withLongOpt("transpose").create();
}

From source file:org.opendatakit.briefcase.ui.MainBriefcaseWindow.java

/**
 * Setting up options for Command Line Interface
 * @return/* ww  w. j a  v  a2  s .  co m*/
 */
@SuppressWarnings("static-access")
static Options addOptions() {
    Options options = new Options();

    Option server = OptionBuilder.withArgName("url").hasArg().withLongOpt(AGGREGATE_URL)
            .withDescription("ODK Aggregate URL (must start with http:// or https://)").create("url");

    Option username = OptionBuilder.withArgName("username").hasArg().withLongOpt(ODK_USERNAME)
            .withDescription("ODK username").create("u");

    Option password = OptionBuilder.withArgName("password").hasArg().withLongOpt(ODK_PASSWORD)
            .withDescription("ODK password").create("p");

    Option formid = OptionBuilder.withArgName("form_id").hasArg().withLongOpt(FORM_ID)
            .withDescription("Form ID of form to download and export").create("id");

    Option storageDir = OptionBuilder.withArgName("/path/to/dir").withLongOpt(STORAGE_DIRECTORY).hasArg()
            .withDescription(
                    "Directory to create or find ODK Briefcase Storage directory (relative path unless it begins with / or C:\\)")
            .create("sd");

    Option exportDir = OptionBuilder.withArgName("/path/to/dir").hasArg().withLongOpt(EXPORT_DIRECTORY)
            .withDescription(
                    "Directory to export the CSV and media files into (relative path unless it begins with / or C:\\)")
            .create("ed");

    Option exportMedia = OptionBuilder.withDescription("Flag to exclude media on export")
            .withLongOpt(EXCLUDE_MEDIA_EXPORT).create("em");

    Option startDate = OptionBuilder.withArgName(DATE_FORMAT).hasArg().withLongOpt(EXPORT_START_DATE)
            .withDescription("Include submission dates after (inclusive) this date in export to CSV")
            .create("start");

    Option endDate = OptionBuilder.withArgName(DATE_FORMAT).hasArg().withLongOpt(EXPORT_END_DATE)
            .withDescription("Include submission dates before (exclusive) this date in export to CSV")
            .create("end");

    Option exportFilename = OptionBuilder.withArgName("name.csv").hasArg().withLongOpt(EXPORT_FILENAME)
            .withDescription("File name for exported CSV").create("f");

    Option overwrite = OptionBuilder.withLongOpt(OVERWRITE_CSV_EXPORT)
            .withDescription("Flag to overwrite CSV on export").create("oc");

    Option help = OptionBuilder.withLongOpt(HELP).withDescription("Print help information (this screen)")
            .create("h");

    Option version = OptionBuilder.withLongOpt(VERSION).withDescription("Print version information")
            .create("v");

    Option odkDir = OptionBuilder.withArgName("/path/to/dir").hasArg().withLongOpt(ODK_DIR)
            .withDescription("/odk directory from ODK Collect (relative path unless it begins with / or C:\\)")
            .create("od");

    Option keyFile = OptionBuilder.withArgName("/path/to/file.pem").hasArg().withLongOpt(PEM_FILE)
            .withDescription("PEM private key file (relative path unless it begins with / or C:\\)")
            .create("pf");

    options.addOption(server);
    options.addOption(username);
    options.addOption(password);
    options.addOption(formid);
    options.addOption(storageDir);
    options.addOption(exportDir);
    options.addOption(exportMedia);
    options.addOption(startDate);
    options.addOption(endDate);
    options.addOption(exportFilename);
    options.addOption(overwrite);
    options.addOption(help);
    options.addOption(version);
    options.addOption(odkDir);
    options.addOption(keyFile);

    return options;
}

From source file:org.openmainframe.ade.ext.main.Analyze.java

/**
 * Method to parse specific arguments for "Analyze".
 *///from  w w w  .  j a  va2  s  . com
@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);

}

From source file:org.openmainframe.ade.ext.main.helper.AdeExtOptions.java

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);/*from  ww  w  .  j  av  a 2s .c o  m*/
    }

    /* 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;
}

From source file:org.openmainframe.ade.ext.main.helper.LinuxOptions.java

@Override
public void addPlatformSpecificOptions(Options options) {
    OptionBuilder.withArgName(OPTION_YEAR);
    OptionBuilder.hasArg();/*ww w.j a  v a2 s .  c  om*/
    OptionBuilder.withDescription("year of messages in Linux syslogs");
    options.addOption(OptionBuilder.create(OPTION_YEAR));
}

From source file:org.openmainframe.ade.ext.main.UpdateGroups.java

/**
 * Method for building the allowed options.
 * @param options Options object for adding the options created with OptionBuilder.
 *///from w w  w  . jav  a 2  s .  c  o m
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"));
}