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:de.clusteval.data.dataset.generator.CircleDataSetGenerator.java

@Override
protected Options getOptions() {
    Options options = new Options();

    OptionBuilder.withArgName("n");
    OptionBuilder.isRequired();//  ww  w  .  j a va 2 s. c  om
    OptionBuilder.hasArg();
    OptionBuilder.withDescription("The number of points.");
    Option option = OptionBuilder.create("n");
    options.addOption(option);

    OptionBuilder.withArgName("d");
    OptionBuilder.hasArg();
    OptionBuilder.withDescription("The number of dimensions.");
    option = OptionBuilder.create("d");
    options.addOption(option);

    return options;
}

From source file:de.clusteval.data.dataset.generator.SpiralsDataSetGenerator.java

@Override
protected Options getOptions() {
    Options options = new Options();

    OptionBuilder.withArgName("n");
    OptionBuilder.isRequired();/*  w  w w .  j  a  va2s.c  o  m*/
    OptionBuilder.hasArg();
    OptionBuilder.withDescription("The number of points.");
    Option option = OptionBuilder.create("n");
    options.addOption(option);

    OptionBuilder.withArgName("c");
    OptionBuilder.hasArg();
    OptionBuilder.withDescription("The number of cycles.");
    option = OptionBuilder.create("c");
    options.addOption(option);

    OptionBuilder.withArgName("sd");
    OptionBuilder.hasArg();
    OptionBuilder.withDescription("The standard deviation.");
    option = OptionBuilder.create("sd");
    options.addOption(option);

    return options;
}

From source file:jlite.cli.JobSubmit.java

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

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

    options.addOption(OptionBuilder.withDescription("enables extra debug output").create("debug"));

    options.addOption(OptionBuilder.withArgName("dir_path")
            .withDescription("search input files in the specified directory (default is current directory)")
            .hasArg().create("in"));

    options.addOption(OptionBuilder.withArgName("ce_id")
            .withDescription("send job to specified computing element").hasArg().create("r"));

    options.addOption(OptionBuilder.withArgName("file_path").withDescription("write job id to specified file")
            .hasArg().create("o"));

    options.addOption(OptionBuilder.withArgName("id_string")
            .withDescription("delegation id (default is user name)").hasArg().create("d"));

    options.addOption(OptionBuilder.withDescription("automatic proxy delegation").create("a"));

    options.addOption(OptionBuilder.withArgName("service_URL").withDescription("WMProxy service endpoint")
            .hasArg().create("e"));

    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("protocol")
    //                .withDescription("protocol to be used for file tranfer {gsiftp,https} (default is gsiftp)")
    //                .hasArg()
    //                .create("proto"));

    return options;
}

From source file:de.clusteval.data.dataset.generator.HyperCubeCornersDataSetGenerator.java

@Override
protected Options getOptions() {
    Options options = new Options();

    OptionBuilder.withArgName("n");
    OptionBuilder.isRequired();/*from www  .j a  v  a  2  s.  com*/
    OptionBuilder.hasArg();
    OptionBuilder.withDescription("The number of points.");
    Option option = OptionBuilder.create("n");
    options.addOption(option);

    OptionBuilder.withArgName("d");
    OptionBuilder.hasArg();
    OptionBuilder.withDescription("The number of dimensions.");
    option = OptionBuilder.create("d");
    options.addOption(option);

    OptionBuilder.withArgName("sd");
    OptionBuilder.hasArg();
    OptionBuilder.withDescription("The standard deviation.");
    option = OptionBuilder.create("sd");
    options.addOption(option);

    return options;
}

From source file:com.google.code.stackexchange.client.examples.AnswersApiExample.java

/**
 * Builds the options.//w w w . j a va2 s .  co m
 * 
 * @return the options
 */
private static Options buildOptions() {

    Options opts = new Options();

    String helpMsg = "Print this message.";
    Option help = new Option(HELP_OPTION, helpMsg);
    opts.addOption(help);

    String consumerKeyMsg = "You API Key.";
    OptionBuilder.withArgName("key");
    OptionBuilder.hasArg();
    OptionBuilder.withDescription(consumerKeyMsg);
    Option consumerKey = OptionBuilder.create(APPLICATION_KEY_OPTION);
    opts.addOption(consumerKey);

    String idMsg = "ID of the users to whom a message is to be sent (separated by comma).";
    OptionBuilder.withArgName("id");
    OptionBuilder.hasArg();
    OptionBuilder.withDescription(idMsg);
    Option id = OptionBuilder.create(ID_OPTION);
    opts.addOption(id);

    return opts;
}

From source file:info.extensiblecatalog.OAIToolkit.importer.CLIProcessor.java

/**
 * Setup the command line options object
 * @return the command line options object
 *///w w  w .j ava  2 s. c o  m
public static Options getCommandLineOptions() {

    Option convert = new Option("convert", "Flag to convert file(s) with raw MARC records into MARCXML");

    OptionBuilder.withArgName("modify");
    OptionBuilder.hasArg();
    OptionBuilder.withDescription("Flag to modify MARCXML file(s) with XSLT transromation with the"
            + "given XSLT files before loading into the OAI repository");
    Option modify = OptionBuilder.create("modify");

    Option load = new Option("load", "Flag to load file(s) into the OAI repository");

    Option production = new Option("production", "Flag to switch production mode. It means, that the"
            + "toolkit won't create any temporary files (except error"
            + " records) so it read MARC records, process it, and put "
            + "directly to the database or the target file format [DEPRECATED: OPTION IS NO LONGER AVAILABLE]");

    OptionBuilder.withArgName("source");
    OptionBuilder.hasArg();
    OptionBuilder.withDescription("The directory where the toolkit looks " + "for files to process");
    Option source = OptionBuilder.create("source");

    OptionBuilder.withArgName("destination");
    OptionBuilder.hasArg();
    OptionBuilder.withDescription("The directory that the toolkit moves the source files into "
            + "as it successfully completes the processing of each file.");
    Option destination = OptionBuilder.create("destination");

    OptionBuilder.withArgName("destination_xml");
    OptionBuilder.hasArg();
    OptionBuilder
            .withDescription("The directory that the toolkit places " + "MARCXML versions of the source data.");
    Option destination_xml = OptionBuilder.create("destination_xml");

    OptionBuilder.withArgName("destination_modifiedxml");
    OptionBuilder.hasArg();
    OptionBuilder.withDescription(
            "The directory that the toolkit places " + "modified MARCXML versions of the source data.");
    Option destination_modifiedxml = OptionBuilder.create("destination_modifiedxml");

    OptionBuilder.withArgName("error");
    OptionBuilder.hasArg();
    OptionBuilder.withDescription("The directory that the toolkit moves files into when "
            + "there is a processing error for that file.");
    Option error = OptionBuilder.create("error");

    OptionBuilder.hasArg();
    OptionBuilder.withArgName("error_xml");
    OptionBuilder.withDescription("The directory that the toolkit places MARCXML versions of "
            + "the source data, if that MARCXML file was unable to be "
            + "loaded into the OAI repository due to an error condition.");
    Option error_xml = OptionBuilder.create("error_xml");

    OptionBuilder.hasArg();
    OptionBuilder.withArgName("error_modifiedxml");
    OptionBuilder.withDescription("The directory that the toolkit places MARCXML versions of "
            + "the source data, if that MARCXML file was unable to be "
            + "loaded into the OAI repository due to an error condition.");
    Option error_modifiedxml = OptionBuilder.create("error_modifiedxml");

    OptionBuilder.withArgName("log");
    OptionBuilder.hasArg();
    OptionBuilder.withDescription("The directory of log files for " + "warnings and errors");
    Option log = OptionBuilder.create("log");

    Option log_detail = new Option("log_detail", "Flag to offer more detailed processing log information");

    OptionBuilder.withArgName("marc_schema");
    OptionBuilder.hasArg();
    OptionBuilder.withDescription("XML Schema file for MARCXML validation");
    Option marc_schema = OptionBuilder.create("marc_schema");

    OptionBuilder.withArgName("marc_encoding");
    OptionBuilder.hasArg();
    OptionBuilder.withDescription("The encoding of the MARC file");
    Option marc_encoding = OptionBuilder.create("marc_encoding");

    OptionBuilder.withArgName("char_conversion");
    OptionBuilder.hasArg();
    OptionBuilder.withDescription(
            "The character conversion method. " + "Possible values: MARC8 (Ansel), ISO5426, ISO6937, none");
    Option char_conversion = OptionBuilder.create("char_conversion");

    OptionBuilder.withArgName("split_size");
    OptionBuilder.hasArg();
    OptionBuilder.withDescription("How many records can an XML file" + " contain?");
    Option split_size = OptionBuilder.create("split_size");

    OptionBuilder.withArgName("lucene_index");
    OptionBuilder.hasArg();
    OptionBuilder.withDescription("Lucene index directory.");
    Option lucene_index = OptionBuilder.create("lucene_index");

    //OptionBuilder.withArgName("storage_type");
    //OptionBuilder.hasArg();
    //OptionBuilder.withDescription("The storage type of records: MySQL," +
    //" mixed, Lucene.");
    //Option storage_type = OptionBuilder.create("storage_type");

    Option indent_xml = new Option("indent_xml", "Flag to indent XML");

    Option xml_version_11 = new Option("xml_version_11", "Flag to create XML 1.1 instead of 1.0");

    Option translate_leader_bad_chars_to_zero = new Option("translate_leader_bad_chars_to_zero",
            "Change the Bad characters in the leader to zeros");

    Option translate_nonleader_bad_chars_to_spaces = new Option("translate_nonleader_bad_chars_to_spaces",
            "Change the Bad characters in the control and the data fields to spaces");

    Option modify_validation = new Option("modify_validation", "Perform validation check during modify step");

    OptionBuilder.withArgName("replace_repository_code");
    OptionBuilder.hasArg();
    OptionBuilder.withDescription("Replace repository code.");
    Option replace_repository_code = OptionBuilder.create("replace_repository_code");

    OptionBuilder.withArgName("convert_dir");
    OptionBuilder.hasArg();
    OptionBuilder.withDescription("The directory of marc files after " + "process.");
    Option convert_dir = OptionBuilder.create("convert_dir");

    Option fileof_deleted_records = new Option("fileof_deleted_records",
            "The source marc file should be considered as deleted");

    Option lucene_statistics = new Option("lucene_statistics", "Statistics for Lucene Database");

    Option lucene_dump_ids = new Option("lucene_dump_ids", "List all ids (001s) to standard output");

    OptionBuilder.withArgName("load_dir");
    OptionBuilder.hasArg();
    OptionBuilder.withDescription("The directory of marcxml files after" + " process.");
    Option load_dir = OptionBuilder.create("load_dir");

    OptionBuilder.withArgName("modify_dir");
    OptionBuilder.hasArg();
    OptionBuilder.withDescription("The directory of modified marcxml " + "files after process.");
    Option modify_dir = OptionBuilder.create("modify_dir");

    OptionBuilder.withArgName("error_suffix");
    OptionBuilder.hasArg();
    OptionBuilder.withDescription("The suffix of directory name of error" + " files after process.");
    Option error_suffix = OptionBuilder.create("error_suffix");

    OptionBuilder.withArgName("destination_suffix");
    OptionBuilder.hasArg();
    OptionBuilder.withDescription("The suffix of directory name of files" + " after process.");
    Option destination_suffix = OptionBuilder.create("destination_suffix");

    OptionBuilder.withArgName("default_repository_code");
    OptionBuilder.hasArg();
    OptionBuilder.withDescription("The default value of " + "repository code (field 003).");
    Option default_repository_code = OptionBuilder.create("default_repository_code");

    Option delete = new Option("delete", "Delete temporary files?");

    Option ignore_repository_code = new Option("ignore_repository_code", "Do not merge 003 and 001 together.");

    Option help = new Option("help", "list available options");

    Options options = new Options();
    options.addOption(production);
    options.addOption(convert);
    options.addOption(modify);
    options.addOption(load);
    options.addOption(source);
    options.addOption(destination);
    options.addOption(destination_xml);
    options.addOption(error);
    options.addOption(error_xml);
    options.addOption(log);
    options.addOption(log_detail);
    options.addOption(marc_schema);
    options.addOption(marc_encoding);
    options.addOption(char_conversion);
    options.addOption(split_size);
    options.addOption(lucene_index);
    //options.addOption(storage_type);
    options.addOption(indent_xml);
    options.addOption(xml_version_11);
    options.addOption(translate_leader_bad_chars_to_zero);
    options.addOption(modify_validation);
    options.addOption(translate_nonleader_bad_chars_to_spaces);
    options.addOption(fileof_deleted_records);
    options.addOption(lucene_statistics);
    options.addOption(lucene_dump_ids);
    options.addOption(replace_repository_code);
    options.addOption(convert_dir);
    options.addOption(load_dir);
    options.addOption(modify_dir);
    options.addOption(error_suffix);
    options.addOption(destination_suffix);
    options.addOption(delete);
    options.addOption(destination_modifiedxml);
    options.addOption(error_modifiedxml);
    options.addOption(default_repository_code);
    options.addOption(ignore_repository_code);
    options.addOption(help);

    return options;
}

From source file:com.aliyun.openservices.odps.console.commands.logview.GetTaskDetailsAction.java

@SuppressWarnings("static-access")
public Options getOptions() {
    Options options = super.getOptions();
    options.addOption(OptionBuilder.withDescription("sort by duration").withLongOpt("duration").create('d'));
    options.addOption(OptionBuilder.withDescription("maximum log process number").withLongOpt("limit").hasArg()
            .create('l'));
    options.addOption(OptionBuilder.withDescription("reverse the sort order of results").withLongOpt("reverse")
            .create('r'));
    options.addOption(/*from   w  w w.j a  v a 2  s  .c  o  m*/
            OptionBuilder.withDescription("select running processes").withLongOpt("running").create('R'));
    options.addOption(
            OptionBuilder.withDescription("select failed processes").withLongOpt("failed").create('F'));
    return options;
}

From source file:io.github.agentsoz.abmjadex.super_central.ABMSimStarter.java

@SuppressWarnings({ "static-access" })
private static Options commandLinePreparation() {
    Options options = new Options();

    // create the Options      
    options.addOption(HELP, "help", false, "print the help list on usage (this message.)");
    options.addOption(FORCED, "force", false, "overwrite any CentralOrganizer created before.");
    options.addOption(LOG_CONSOLE, false, "Deciding whether to show logging to console or not");

    options.addOption(OptionBuilder.withDescription("Launch JCC or not (by default : not)").hasArg()
            .withArgName("run_jcc").create(GUI));
    options.addOption(//from  ww w  .  j  a  v  a  2s  . c  o  m
            OptionBuilder.withLongOpt("properties").withDescription("Locate the app's properties file").hasArg()
                    .withArgName("properties_file").create(PROP));
    options.addOption(OptionBuilder
            .withDescription("Choose the starting mode." + "sc_only, will run only the SuperCentral,"
                    + "sc_co, will run both sc and co specified in properties file"
                    + "co_only, will run only a central organizer")
            .hasArg().withArgName("start_mode").create(MODE));
    options.addOption(OptionBuilder
            .withDescription("Setup the logging level."
                    + "{SEVERE,WARNING,INFO,CONFIG,FINE,FINER,FINEST}(default: INFO)")
            .hasArg().withArgName("log_level").create(LOG_LVL));
    return options;
}

From source file:net.nicholaswilliams.java.licensing.licensor.interfaces.cli.spi.CliOptionsBuilder.java

public CliOptionsBuilder withDescription(String newDescription) {
    OptionBuilder.withDescription(newDescription);
    return this;
}

From source file:com.github.joemcintyre.pdffinish.Main.java

/**
 * Populate command line options, making available for command line
 * processing and usage message functions.
 *//*from  w  w  w  .  j  av a2s  .  c  o  m*/
private static void populateOptions() {
    options = new Options();
    options.addOption("s", "show", false, "Show PDF metadata and ToC");
    options.addOption("v", "version", false, "Show version number");
    options.addOption("h", "help", false, "Print this message");

    OptionBuilder.withArgName("inputFile");
    OptionBuilder.hasArg();
    OptionBuilder.withDescription("input PDF file");
    options.addOption(OptionBuilder.create("i"));

    OptionBuilder.withArgName("outputFile");
    OptionBuilder.hasArg();
    OptionBuilder.withDescription("output PDF file");
    options.addOption(OptionBuilder.create("o"));

    OptionBuilder.withArgName("configFile");
    OptionBuilder.hasArg();
    OptionBuilder.withDescription("configuration file (JSON)");
    options.addOption(OptionBuilder.create("c"));
}