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

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

Introduction

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

Prototype

public void setRequired(boolean required) 

Source Link

Document

Sets whether this Option is mandatory.

Usage

From source file:com.alibaba.rocketmq.tools.command.namesrv.UpdateProjectGroupCommand.java

@Override
public Options buildCommandlineOptions(Options options) {
    Option opt = new Option("i", "ip", true, "set the server ip");
    opt.setRequired(true);
    options.addOption(opt);/*from  w w w. j  a va2s . c  o  m*/

    opt = new Option("p", "project", true, "set the project group");
    opt.setRequired(true);
    options.addOption(opt);
    return options;
}

From source file:com.alibaba.rocketmq.tools.command.namesrv.DeleteKvConfigCommand.java

@Override
public Options buildCommandlineOptions(Options options) {
    Option opt = new Option("s", "namespace", true, "set the namespace");
    opt.setRequired(true);
    options.addOption(opt);//from w w  w.java 2s.c  o  m

    opt = new Option("k", "key", true, "set the key name");
    opt.setRequired(true);
    options.addOption(opt);
    return options;
}

From source file:com.alibaba.rocketmq.tools.command.namesrv.DeleteProjectGroupCommand.java

@Override
public Options buildCommandlineOptions(Options options) {
    Option opt = new Option("i", "ip", true, "set the server ip");
    opt.setRequired(false);
    options.addOption(opt);/*from w w  w.  j  a  va2 s .  c  o  m*/

    opt = new Option("p", "project", true, "set the project group");
    opt.setRequired(false);
    options.addOption(opt);
    return options;
}

From source file:com.alibaba.rocketmq.tools.command.broker.CleanUnusedTopicCommand.java

@Override
public Options buildCommandlineOptions(Options options) {
    Option opt = new Option("b", "brokerAddr", true, "Broker address");
    opt.setRequired(false);
    options.addOption(opt);/*  w  w w  . j  a v  a  2  s  .  co m*/

    opt = new Option("c", "cluster", true, "cluster name");
    opt.setRequired(false);
    options.addOption(opt);

    return options;
}

From source file:com.alibaba.rocketmq.tools.command.broker.BrokerStatsSubCommand.java

@Override
public Options buildCommandlineOptions(Options options) {
    Option opt = new Option("b", "brokerAddr", true, "Broker address");
    opt.setRequired(true);
    options.addOption(opt);/*from w  w  w  .  j av a 2  s .  c  om*/

    return options;
}

From source file:com.alibaba.rocketmq.tools.command.namesrv.WipeWritePermSubCommand.java

@Override
public Options buildCommandlineOptions(Options options) {
    Option opt = new Option("b", "brokerName", true, "broker name");
    opt.setRequired(true);
    options.addOption(opt);/*  w w w .  j  a  va2s.  c o m*/
    return options;
}

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

@Override
public Options buildCommandlineOptions(Options options) {
    Option opt = new Option("t", "topic", true, "topic name");
    opt.setRequired(true);
    options.addOption(opt);//from   w ww .ja v  a2  s  . c o  m

    opt = new Option("k", "msgKey", true, "Message Key");
    opt.setRequired(true);
    options.addOption(opt);

    return options;
}

From source file:com.alibaba.rocketmq.tools.command.namesrv.UpdateNamesrvConfigCommand.java

@Override
public Options buildCommandlineOptions(final Options options) {
    Option opt = new Option("k", "key", true, "config key");
    opt.setRequired(true);
    options.addOption(opt);// w ww. j  a  v  a  2s.c  o  m

    opt = new Option("v", "value", true, "config value");
    opt.setRequired(true);
    options.addOption(opt);

    return options;
}

From source file:com.alibaba.rocketmq.tools.command.namesrv.UpdateKvConfigCommand.java

@Override
public Options buildCommandlineOptions(Options options) {
    Option opt = new Option("s", "namespace", true, "set the namespace");
    opt.setRequired(true);
    options.addOption(opt);/*  w w w.j  a v a2s. c  o  m*/

    opt = new Option("k", "key", true, "set the key name");
    opt.setRequired(true);
    options.addOption(opt);

    opt = new Option("v", "value", true, "set the key value");
    opt.setRequired(true);
    options.addOption(opt);
    return options;
}

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);
    options.addOption(opt);/*ww  w .ja va2  s .co  m*/

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

    return options;
}