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

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

Introduction

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

Prototype

String longOpt

To view the source code for org.apache.commons.cli Option longOpt.

Click Source Link

Document

the long representation of the option

Usage

From source file:org.zend.sdkcli.internal.options.DetectOptionUtility.java

private static void addBoolean(Options options, Method method) {
    final Option a = method.getAnnotation(Option.class);

    // create option object
    final org.apache.commons.cli.Option o = new org.apache.commons.cli.Option(a.opt(), a.description());
    if (a.longOpt() != null && a.longOpt().length() > 0) {
        o.setLongOpt(a.longOpt());//from  w w  w  . j a  v a 2 s .c  om
    }
    o.setArgs(0);
    o.setRequired(a.required());

    // assign to options list options.addOption(o);
    options.addOption(o);
}

From source file:org.zend.sdkcli.internal.options.DetectOptionUtility.java

private static void addString(Options options, Method method) {
    final Option a = method.getAnnotation(Option.class);

    // create option object
    final org.apache.commons.cli.Option o = new org.apache.commons.cli.Option(a.opt(), a.description());
    if (a.longOpt() != null && a.longOpt().length() > 0) {
        o.setLongOpt(a.longOpt());/*from   ww w .  j ava2s  .co m*/
    }
    o.setArgs(a.numberOfArgs());
    o.setRequired(a.required());
    o.setType(a.type());
    o.setArgName(a.argName());

    // assign to options list
    options.addOption(o);
}