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.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);//from ww  w  .j av  a2  s. co  m
    options.addOption(filenameOption);

    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.ca.CACertStatusCLI.java

public void createOptions() {
    Option option = new Option(null, "ocsp", true, "OCSP URL");
    option.setArgName("URL");
    options.addOption(option);/*from ww  w. ja v a2s  .com*/

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

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

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

    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, "cert-encryption", true,
            "Certificate encryption algorithm (default: " + PKCS12Util.DEFAULT_CERT_ENCRYPTION_NAME + ").");
    option.setArgName("algorithm");
    options.addOption(option);

    option = new Option(null, "key-encryption", true,
            "Key encryption algorithm (default: " + PKCS12Util.DEFAULT_KEY_ENCRYPTION_NAME + ").");
    option.setArgName("algorithm");
    options.addOption(option);

    options.addOption(null, "append", false, "Append into an existing 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:de.mat.utils.pdftools.PdfSort4Print.java

@Override
protected Options genAvailiableCmdLineOptions() throws Throwable {
    Options availiableCmdLineOptions = new Options();

    // Hilfe-Option
    Option helpOption = new Option("h", "help", false, "usage");
    helpOption.setRequired(false);//ww  w.  ja va  2 s . co  m
    availiableCmdLineOptions.addOption(helpOption);

    Option inFile = new Option("i", "in", true, "Input-File");
    inFile.setRequired(true);
    availiableCmdLineOptions.addOption(inFile);

    Option outFile = new Option("o", "out", true, "Outputfile");
    outFile.setRequired(true);
    availiableCmdLineOptions.addOption(outFile);

    Option perpage = new Option("p", "perPage", true, "pro Seite");
    perpage.setRequired(true);
    availiableCmdLineOptions.addOption(perpage);

    return availiableCmdLineOptions;
}

From source file:com.buildml.main.commands.CliCommandShowInputFiles.java

@Override
public Options getOptions() {

    /* start with the standard show-files options */
    Options opts = super.getOptions();

    /* add the --all option */
    Option allOpt = new Option("a", "all", false, "Also show indirect file inputs.");
    opts.addOption(allOpt);/*from  w  ww .j a  v  a 2  s. co  m*/

    return opts;
}