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.netscape.cmstools.tps.profile.ProfileAddCLI.java

public void createOptions() {
    Option option = new Option(null, "input", true, "Input file containing profile properties.");
    option.setArgName("file");
    option.setRequired(true);
    options.addOption(option);/*from   w  ww  .j  a v  a2s  .  co  m*/
}

From source file:com.kurtraschke.amtkgtfsrealtime.AMTKRealtimeMain.java

private void buildOptions(Options options) {
    Option configFile = new Option(ARG_CONFIG_FILE, true, "configuration file path");
    configFile.setRequired(true);
    options.addOption(configFile);//  www .  j  a va  2s . c o m
}

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

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

From source file:com.netscape.cmstools.tps.authenticator.AuthenticatorAddCLI.java

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

From source file:com.netscape.cmstools.user.UserAddCLI.java

public void createOptions() {
    Option option = new Option(null, "fullName", true, "Full name");
    option.setArgName("fullName");
    option.setRequired(true);
    options.addOption(option);//from   ww w . ja  v  a 2 s.  c om

    option = new Option(null, "email", true, "Email");
    option.setArgName("email");
    options.addOption(option);

    option = new Option(null, "password", true, "Password");
    option.setArgName("password");
    options.addOption(option);

    option = new Option(null, "phone", true, "Phone");
    option.setArgName("phone");
    options.addOption(option);

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

    option = new Option(null, "state", true, "State");
    option.setArgName("state");
    options.addOption(option);
}

From source file:com.opengamma.integration.marketdata.PeriodicLiveDataTimeSeriesStorageTool.java

@Override
protected Options createOptions(boolean contextProvided) {

    Options options = super.createOptions(contextProvided);

    Option filenameOption = new Option(FILE_NAME_OPT, "filename", true,
            "The path to the file containing data to import (CSV or ZIP)");
    filenameOption.setRequired(false);
    options.addOption(filenameOption);//  w w w.ja v  a  2 s. co m

    Option timeSeriesDataSourceOption = new Option(TIME_SERIES_DATASOURCE_OPT, "source", true,
            "The name of the time series data source");
    timeSeriesDataSourceOption.setRequired(true);
    options.addOption(timeSeriesDataSourceOption);

    Option timeSeriesDataProviderOption = new Option(TIME_SERIES_DATAPROVIDER_OPT, "provider", true,
            "The name of the time series data provider");
    timeSeriesDataProviderOption.setRequired(true);
    options.addOption(timeSeriesDataProviderOption);

    Option userNameOption = new Option(USER_NAME_OPT, "user", true,
            "The name of the user for entitlement checking");
    userNameOption.setRequired(false);
    options.addOption(userNameOption);

    Option writeToDbOption = new Option(WRITE_TO_DB_OPT, "write", false,
            "Set to enable writing to DB. False by default for safety");
    writeToDbOption.setRequired(false);
    options.addOption(writeToDbOption);

    return options;
}

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);
    options.addOption(option);/*  w  w w .jav  a 2s. c om*/
}

From source file:com.alibaba.rocketmq.tools.command.connection.ConnectionSubCommand.java

@Override
public Options buildCommandlineOptions(Options options) {
    Option opt = new Option("p", "producerGroup", true, "producer group name");
    opt.setRequired(false);
    options.addOption(opt);/* w  w w.j a v  a2s  .  c o  m*/

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

    // topic
    opt = new Option("t", "topic", true, "topic name");
    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);
    options.addOption(opt);/*from w  w  w  . j  a v a2s.  co  m*/

    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.ict.dtube.tools.command.message.QueryMsgByIdSubCommand.java

@Override
public Options buildCommandlineOptions(Options options) {
    Option opt = new Option("i", "msgId", true, "Message Id");
    opt.setRequired(true);
    options.addOption(opt);//w ww. j a v a  2s .com

    return options;
}