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:ditl.cli.WriteApp.java

@Override
protected void initOptions() {
    options.addOption(new Option("f", forceOption, false, "Force overwrite existing traces."));
}

From source file:com.alibaba.rocketmq.tools.command.message.CheckMsgSendRTCommand.java

@Override
public Options buildCommandlineOptions(Options options) {
    Option opt = new Option("t", "topic", true, "topic name");
    opt.setRequired(true);//w w  w  . jav  a  2  s . c  om
    options.addOption(opt);

    opt = new Option("a", "amout", true, "message amout | default 100");
    opt.setRequired(false);
    options.addOption(opt);

    opt = new Option("s", "size", true, "message size | default 128 Byte");
    opt.setRequired(true);
    options.addOption(opt);
    return options;
}

From source file:com.alibaba.rocketmq.tools.command.consumer.ConsumerStatusSubCommand.java

@Override
public Options buildCommandlineOptions(Options options) {
    Option opt = new Option("g", "consumerGroup", true, "consumer group name");
    opt.setRequired(true);//from  ww  w. ja va  2  s . c  o m
    options.addOption(opt);

    opt = new Option("i", "clientId", true, "The consumer's client id");
    opt.setRequired(false);
    options.addOption(opt);

    opt = new Option("s", "jstack", false, "Run jstack command in the consumer progress");
    opt.setRequired(false);
    options.addOption(opt);

    return options;
}

From source file:com.alibaba.rocketmq.tools.command.message.PrintMessageSubCommand.java

@Override
public Options buildCommandlineOptions(Options options) {
    Option opt = new Option("t", "topic", true, "topic name");
    opt.setRequired(true);//w w  w .  ja v  a 2s  . co m
    options.addOption(opt);

    opt = new Option("c", "charsetName ", true, "CharsetName(eg: UTF-8?GBK)");
    opt.setRequired(false);
    options.addOption(opt);

    opt = new Option("s", "subExpression ", true, "Subscribe Expression(eg: TagA || TagB)");
    opt.setRequired(false);
    options.addOption(opt);

    opt = new Option("b", "beginTimestamp ", true,
            "Begin timestamp[currentTimeMillis|yyyy-MM-dd#HH:mm:ss:SSS]");
    opt.setRequired(false);
    options.addOption(opt);

    opt = new Option("e", "endTimestamp ", true, "End timestamp[currentTimeMillis|yyyy-MM-dd#HH:mm:ss:SSS]");
    opt.setRequired(false);
    options.addOption(opt);

    return options;
}

From source file:com.netscape.cmstools.pkcs7.PKCS7CertExportCLI.java

public void createOptions() {
    Option option = new Option(null, "pkcs7-file", true, "PKCS #7 file");
    option.setArgName("path");
    options.addOption(option);// w  w  w  .java  2s. c  o  m

    option = new Option(null, "output-prefix", true, "Prefix for output file");
    option.setArgName("string");
    options.addOption(option);

    option = new Option(null, "output-suffix", true, "Suffix for output file");
    option.setArgName("string");
    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.alibaba.rocketmq.tools.command.broker.BrokerConsumeStatsSubCommad.java

@Override
public Options buildCommandlineOptions(Options options) {
    Option opt = new Option("b", "brokerAddr", true, "Broker address");
    opt.setRequired(true);// w w w.  j  a va2s  . com
    options.addOption(opt);

    opt = new Option("t", "timeoutMillis", true, "request timeout Millis");
    opt.setRequired(false);
    options.addOption(opt);

    opt = new Option("l", "level", true, "threshold of print diff");
    opt.setRequired(false);
    options.addOption(opt);

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

    return options;
}

From source file:com.garethahealy.quotalimitsgenerator.cli.parsers.DefaultCLIParser.java

public Options getOptions() {
    //Setup the options we can use on the command line
    Option instanceTypeCsv = new Option("csv", "instance-type-csv", true, "Instance type csv information");
    Option instanceType = new Option("it", "instance-type", true, "Instance type, i.e.: small, medium");
    Option qualityOfService = new Option("qos", "quality-of-service", true,
            "Quality of service required in project, i.e.: besteffort or burstable");
    Option nodeWorkerCount = new Option("nwc", "node-worker-count", true,
            "Number of work nodes in cluster, i.e.: 1");
    Option isTeamNamespace = new Option("itn", "is-team-namespace", true,
            "Is this for several projects or just one, i.e.: true");
    Option requestRatio = new Option("rr", "request-ratio", true,
            "Request ration to limit for CPU and Memory, i.e.: 3");
    Option output = new Option("o", "output", true, "Output directory, i.e.: /tmp/quotas-and-limits");

    Options options = new Options();
    options.addOption(instanceTypeCsv);//from   w  w w.  ja  v  a2  s  . c om
    options.addOption(instanceType);
    options.addOption(qualityOfService);
    options.addOption(nodeWorkerCount);
    options.addOption(isTeamNamespace);
    options.addOption(requestRatio);
    options.addOption(output);

    return options;
}

From source file:com.netscape.cmstools.ca.CACertHoldCLI.java

public void createOptions() {
    Option option = new Option(null, "comments", true, "Comments");
    option.setArgName("comments");
    options.addOption(option);//  ww  w .  j  ava2  s.com

    options.addOption(null, "force", false, "Force");
}

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

@Override
public Options buildCommandlineOptions(Options options) {
    Option opt = new Option("t", "topic", true, "topic name");
    opt.setRequired(true);/*ww w  . jav a  2s  . c  om*/
    options.addOption(opt);

    opt = new Option("i", "ipList", true, "ipList");
    opt.setRequired(true);
    options.addOption(opt);

    return options;
}

From source file:com.netscape.cmstools.client.ClientCertShowCLI.java

public void createOptions() {
    Option option = new Option(null, "cert", true, "PEM file to store the certificate.");
    option.setArgName("path");
    options.addOption(option);//ww w. j av  a2 s.  c o m

    option = new Option(null, "private-key", true, "PEM file to store the private key.");
    option.setArgName("path");
    options.addOption(option);

    option = new Option(null, "client-cert", true, "PEM file to store the certificate and the private key.");
    option.setArgName("path");
    options.addOption(option);

    option = new Option(null, "pkcs12", true,
            "PKCS #12 file to store the certificate chain and the private key.");
    option.setArgName("path");
    options.addOption(option);

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