Example usage for org.apache.commons.cli Option Option

List of usage examples for org.apache.commons.cli Option Option

Introduction

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

Prototype

public Option(String opt, String longOpt, boolean hasArg, String description) throws IllegalArgumentException 

Source Link

Document

Creates an Option using the specified parameters.

Usage

From source file:com.netscape.cmstools.tps.config.ConfigModifyCLI.java

public void createOptions() {
    Option option = new Option(null, "input", true, "Input file containing general properties.");
    option.setArgName("file");
    option.setRequired(true);/* ww w .j a  va  2 s.c  om*/
    options.addOption(option);

    option = new Option(null, "output", true, "Output file to store general properties.");
    option.setArgName("file");
    options.addOption(option);
}

From source file:com.github.xwgou.namesurfer.cli.JSurferOptions.java

public JSurferOptions() {
    Option help = OptionBuilder.withLongOpt("help").withDescription("display this help text and exit").create();
    Option version = OptionBuilder.withLongOpt("version").withDescription("print program version and exit")
            .create();/* w w w.  ja  v a 2 s.  com*/
    Option disable_buttons = OptionBuilder.withLongOpt("disable-buttons")
            .withDescription("disable the export and save buttons").create();

    Option r = new Option("r", "rules", true, "specify the word translation "
            + "rules as rules.properties. Example: " + "-r $yourpath/rules.properties");

    Option k = new Option("k", "key", true, "specify the keyword rules"
            + " translation as keywords.properties. Example: " + "-k $yourpath/keywords.properties");

    Option f = new Option("f", "fullscreen", false, "run in full screen mode");

    this.addOption(help);
    this.addOption(version);
    this.addOption(disable_buttons);
    this.addOption(r);
    this.addOption(k);
    this.addOption(f);
}

From source file:com.netscape.cmstools.kra.KRAKeyRequestFindCLI.java

public void createOptions() {
    Option option = new Option(null, "status", true, "Request status");
    option.setArgName("status");
    options.addOption(option);/*from  w w  w  .  j  a  va 2 s.  c  o m*/

    option = new Option(null, "type", true, "Request type");
    option.setArgName("type");
    options.addOption(option);

    option = new Option(null, "client", true, "Client ID");
    option.setArgName("client ID");
    options.addOption(option);

    option = new Option(null, "maxResults", true, "Maximum results");
    option.setArgName("max results");
    options.addOption(option);

    option = new Option(null, "maxTime", true, "Maximum time");
    option.setArgName("max time");
    options.addOption(option);

    option = new Option(null, "start", true, "Page to start");
    option.setArgName("starting page");
    options.addOption(option);

    option = new Option(null, "pageSize", true, "Page size");
    option.setArgName("page size");
    options.addOption(option);

    option = new Option(null, "realm", true, "Authorization Realm");
    option.setArgName("realm");
    options.addOption(option);
}

From source file:com.mebigfatguy.junitflood.JUnitFlood.java

private static Options createOptions() {
    Options options = new Options();
    Option option;/*  w ww .  j a  v a  2s. c om*/

    option = new Option("c", "classPath", true, "The classpath on which to generate unit tests");
    option.setRequired(true);
    options.addOption(option);

    option = new Option("a", "auxClassPath", true, "Auxilliary classpath needed to generate unit tests");
    option.setRequired(true);
    options.addOption(option);

    options.addOption("o", "outputPath", true, "The output path where unit tests will be generated");
    option.setRequired(true);
    options.addOption(option);

    options.addOption("r", "rulesFile", true, "The file that holds rules for generating classes");
    options.addOption(option);

    return options;
}

From source file:com.netscape.cmstools.tps.connector.ConnectorModifyCLI.java

public void createOptions() {
    Option option = new Option(null, "action", true,
            "Action: update (default), approve, reject, enable, disable.");
    option.setArgName("action");
    options.addOption(option);/* w  w  w  . j a v a 2  s.  c  o  m*/

    option = new Option(null, "input", true, "Input file containing connector properties.");
    option.setArgName("file");
    options.addOption(option);
}

From source file:com.alibaba.rocketmq.tools.command.topic.UpdateTopicSubCommand.java

@Override
public Options buildCommandlineOptions(Options options) {
    Option opt = new Option("b", "brokerAddr", true, "create topic to which broker");
    opt.setRequired(false);/*from  www. j  a v a  2  s.  c  o m*/
    options.addOption(opt);

    opt = new Option("c", "clusterName", true, "create topic to which cluster");
    opt.setRequired(false);
    options.addOption(opt);

    opt = new Option("t", "topic", true, "topic name");
    opt.setRequired(true);
    options.addOption(opt);

    opt = new Option("r", "readQueueNums", true, "set read queue nums");
    opt.setRequired(false);
    options.addOption(opt);

    opt = new Option("w", "writeQueueNums", true, "set write queue nums");
    opt.setRequired(false);
    options.addOption(opt);

    opt = new Option("p", "perm", true, "set topic's permission(2|4|6), intro[2:R; 4:W; 6:RW]");
    opt.setRequired(false);
    options.addOption(opt);

    opt = new Option("o", "order", true, "set topic's order(true|false");
    opt.setRequired(false);
    options.addOption(opt);

    opt = new Option("u", "unit", true, "is unit topic (true|false");
    opt.setRequired(false);
    options.addOption(opt);

    opt = new Option("s", "hasUnitSub", true, "has unit sub (true|false");
    opt.setRequired(false);
    options.addOption(opt);

    return options;
}

From source file:com.netscape.cmstools.pkcs12.PKCS12CertModCLI.java

public void createOptions() {
    Option option = new Option(null, "pkcs12-file", true, "PKCS #12 file");
    option.setArgName("path");
    options.addOption(option);//from  w ww .  j  a  v  a 2s . com

    option = new Option(null, "pkcs12-password", true, "PKCS #12 password");
    option.setArgName("password");
    options.addOption(option);

    option = new Option(null, "pkcs12-password-file", true, "PKCS #12 password file");
    option.setArgName("path");
    options.addOption(option);

    option = new Option(null, "trust-flags", true, "Certificate trust flags");
    option.setArgName("flags");
    options.addOption(option);

    options.addOption("v", "verbose", false, "Run in verbose mode.");
    options.addOption(null, "debug", false, "Run in debug mode.");
    options.addOption(null, "help", false, "Show help message.");
}

From source file:com.netscape.cmstools.pkcs12.PKCS12CertAddCLI.java

public void createOptions() {
    Option option = new Option(null, "pkcs12-file", true, "PKCS #12 file");
    option.setArgName("path");
    options.addOption(option);//from   w w  w.  j ava  2 s  .  com

    option = new Option(null, "pkcs12-password", true, "PKCS #12 password");
    option.setArgName("password");
    options.addOption(option);

    option = new Option(null, "pkcs12-password-file", true, "PKCS #12 password file");
    option.setArgName("path");
    options.addOption(option);

    options.addOption(null, "new-file", false, "Create a new PKCS #12 file");
    options.addOption(null, "no-trust-flags", false, "Do not include trust flags");
    options.addOption(null, "no-key", false, "Do not include private key");
    options.addOption(null, "no-chain", false, "Do not include certificate chain");

    options.addOption("v", "verbose", false, "Run in verbose mode.");
    options.addOption(null, "debug", false, "Run in debug mode.");
    options.addOption(null, "help", false, "Show help message.");
}

From source file:kieker.tools.loggingTimestampConverter.LoggingTimestampConverterTool.java

@Override
protected void addAdditionalOptions(final Options options) {
    final Option option = new Option(FLAG_TIMESTAMPS_PARAMETER, "timestamps", true,
            "List of timestamps (UTC timezone) to convert");
    option.setArgName("timestamp1 ... timestampN");
    option.setRequired(false);/* ww  w. ja va2  s  .c o  m*/
    option.setArgs(Option.UNLIMITED_VALUES);

    options.addOption(option);
}

From source file:com.netscape.cmstools.tps.profile.ProfileMappingAddCLI.java

public void createOptions() {
    Option option = new Option(null, "input", true, "Input file containing profile mapping properties.");
    option.setArgName("file");
    option.setRequired(true);//from   w  w  w.  ja v a2 s.  c o  m
    options.addOption(option);
}