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

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

Introduction

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

Prototype

Object type

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

Click Source Link

Document

the type of this Option

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  av  a 2s . 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);
}