Example usage for org.apache.commons.cli PatternOptionBuilder STRING_VALUE

List of usage examples for org.apache.commons.cli PatternOptionBuilder STRING_VALUE

Introduction

In this page you can find the example usage for org.apache.commons.cli PatternOptionBuilder STRING_VALUE.

Prototype

Class STRING_VALUE

To view the source code for org.apache.commons.cli PatternOptionBuilder STRING_VALUE.

Click Source Link

Document

String class

Usage

From source file:org.apache.ambari.servicemonitor.utils.OptionHelper.java

/**
 * Add an option that is followed by a string argument
 * @param options options to add it to/*from  w ww. j  a v a 2 s.co  m*/
 * @param shortName short option name
 * @param longName long option name
 * @param description description
 * @return an option that is already added to the option set
 */
public static Option addStringArgOpt(Options options, String shortName, String longName, String description) {
    Option option = new Option(shortName, longName, true, description);
    option.setType(PatternOptionBuilder.STRING_VALUE);
    options.addOption(option);
    return option;
}