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

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

Introduction

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

Prototype

public void setArgName(String argName) 

Source Link

Document

Sets the display name for the argument value.

Usage

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

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

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

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

@Override
public Options getOptions() {

    Options opts = new Options();

    /* add the --show-roots option */
    Option showRootsOpt = new Option("r", "show-roots", false,
            "Show path roots when displaying report output.");
    opts.addOption(showRootsOpt);//from w w w .ja va  2s  .  c om

    /* add the --show-pkgs option */
    Option showPkgsOpt = new Option("p", "show-pkgs", false, "Show package of each path in report output.");
    opts.addOption(showPkgsOpt);

    /* add the -f/--filter option */
    Option filterOpt = new Option("f", "filter", true, "Path-specs used to filter the output.");
    filterOpt.setArgName("path-spec:...");
    opts.addOption(filterOpt);

    return opts;
}

From source file:com.googlecode.jcasockets.perf.ClientOptions.java

private void addOptionWithArgument(String shortOptionName, String longOptionName, String optionDescription,
        String optionArgument) {/*  www.j  a v a  2 s  .co m*/
    Option option = new Option(shortOptionName, longOptionName, true, optionDescription);
    option.setArgName(optionArgument);
    options.addOption(option);
}

From source file:com.soulgalore.crawler.run.CrawlToCsv.java

/**
 * Get the options.//w  w  w . j  a  va  2 s .co m
 * 
 * @return the specific CrawlToCsv options
 */
@Override
protected Options getOptions() {
    final Options options = super.getOptions();

    final Option filenameOption = new Option("f",
            "the name of the csv output file, default name is " + DEFAULT_FILENAME + " [optional]");
    filenameOption.setArgName("FILENAME");
    filenameOption.setLongOpt("filename");
    filenameOption.setRequired(false);
    filenameOption.setArgs(1);

    options.addOption(filenameOption);

    return options;

}

From source file:fr.inrialpes.exmo.align.cli.CommonCLI.java

protected Option createOptionalOption(String name, String longName, String desc, String argName) {
    Option opt = createOption(name, longName, desc);
    opt.setOptionalArg(true);/*w  ww  .  j a v  a 2s . com*/
    opt.setArgName(argName);
    return opt;
}

From source file:com.emc.ecs.util.OptionBuilder.java

public Option create(String opt) {
    // create the option
    Option option = new Option(opt, description);

    // set the option properties
    option.setLongOpt(longOpt);//  w  w w.  j a va 2 s .  c o  m
    option.setArgs(argNum);
    option.setValueSeparator(valueSep);
    option.setArgName(argName);
    return option;
}

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

public void createOptions() {
    StringBuilder sb = new StringBuilder();

    for (RevocationReason reason : RevocationReason.INSTANCES) {
        if (sb.length() > 0) {
            sb.append(", ");
        }/*from w w  w.ja  v  a2 s .c  o m*/
        sb.append(reason);
        if (reason == RevocationReason.UNSPECIFIED) {
            sb.append(" (default)");
        }
    }

    Option option = new Option(null, "reason", true, "Revocation reason: " + sb);
    option.setArgName("reason");
    options.addOption(option);

    option = new Option(null, "comments", true, "Comments");
    option.setArgName("comments");
    options.addOption(option);

    options.addOption(null, "ca", false, "CA signing certificate");
    options.addOption(null, "force", false, "Force");
}

From source file:com.netscape.cmstools.pkcs12.PKCS12CertExportCLI.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.  ja v  a 2s .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-file", true, "Certificate file");
    option.setArgName("path");
    options.addOption(option);

    option = new Option(null, "cert-id", true, "Certificate ID to export");
    option.setArgName("ID");
    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.zimbra.cs.store.file.BlobDeduperUtil.java

private BlobDeduperUtil() {
    options = new Options();

    options.addOption(new Option("h", LO_HELP, false, "Display this help message."));
    options.addOption(new Option("v", LO_VERBOSE, false, "Display stack trace on error."));

    Option o = new Option(null, LO_VOLUMES, true,
            "Specify which volumes to dedupe.  If not specified, dedupe all volumes.");
    o.setArgName("volume-ids");
    options.addOption(o);//  w  w  w. j  av a  2s.  com
}

From source file:edu.vt.middleware.crypt.AbstractEncryptionCli.java

/** {@inheritDoc} */
protected void initOptions() {
    super.initOptions();

    final Option cipher = new Option(OPT_CIPHER, true, "cipher algorithm");
    cipher.setArgName("algname");
    cipher.setOptionalArg(false);//  w w w.  ja v  a2s .  c o m

    final Option infile = new Option(OPT_INFILE, true, "file to encrypt/decrypt; defaults to STDIN");
    infile.setArgName("filepath");
    infile.setOptionalArg(false);

    final Option outfile = new Option(OPT_OUTFILE, true, "output file containing result; defaults to STDOUT");
    outfile.setArgName("filepath");
    outfile.setOptionalArg(false);

    final Option encoding = new Option(OPT_ENCODING, true, "ciphertext encoding format, either base64 or hex");
    encoding.setArgName("format");
    encoding.setOptionalArg(false);

    options.addOption(cipher);
    options.addOption(infile);
    options.addOption(outfile);
    options.addOption(encoding);
    options.addOption(new Option(OPT_TAIL, "tail output from operation"));
}