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

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

Introduction

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

Prototype

int numberOfArgs

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

Click Source Link

Document

the number of argument values this option can have

Usage

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 w w w.  j  a va  2  s  .c o  m*/
    }
    o.setArgs(a.numberOfArgs());
    o.setRequired(a.required());
    o.setType(a.type());
    o.setArgName(a.argName());

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