Uses of Class
org.apache.commons.cli.Option
-
-
Uses of Option in org.apache.commons.cli
Fields in org.apache.commons.cli declared as Option Modifier and Type Field Description protected Option
DefaultParser. currentOption
The last option parsed.private Option
PosixParser. currentOption
Deprecated.Holder for the current option(package private) static Option[]
Option. EMPTY_ARRAY
Empty array.private Option
AlreadySelectedException. option
The option that triggered the exception.private Option
MissingArgumentException. option
The option requiring additional argumentsFields in org.apache.commons.cli with type parameters of type Option Modifier and Type Field Description private static java.util.function.Function<Option,java.lang.String>
HelpFormatter.Builder. DEFAULT_DEPRECATED_FORMAT
A function to convert a description (not null) and a deprecated Option (not null) to help description(package private) static java.util.function.Consumer<Option>
CommandLine.Builder. DEPRECATED_HANDLER
Prints an Option toSystem.out
.private java.util.function.Function<Option,java.lang.String>
HelpFormatter.Builder. deprecatedFormatFunc
Formatter for deprecated options.private java.util.function.Function<Option,java.lang.String>
HelpFormatter. deprecatedFormatFunc
Function to format the description for a deprecated option.private java.util.function.Consumer<Option>
CommandLine.Builder. deprecatedHandler
Deprecated Option handler.private java.util.function.Consumer<Option>
CommandLine. deprecatedHandler
The deprecated option handler.private java.util.function.Consumer<Option>
DefaultParser.Builder. deprecatedHandler
The deprecated option handler.private java.util.function.Consumer<Option>
DefaultParser. deprecatedHandler
The deprecated option handler.private java.util.Map<java.lang.String,Option>
Options. longOpts
A map of the options with the long keyprotected java.util.Comparator<Option>
HelpFormatter. optionComparator
Comparator used to sort the options when they output in help text Defaults to case-insensitive alphabetical sorting by option keyprivate java.util.Map<java.lang.String,Option>
OptionGroup. optionMap
Hold the optionsprivate java.util.List<Option>
CommandLine.Builder. options
The processed optionsprivate java.util.List<Option>
CommandLine. options
The processed optionsprivate java.util.Map<java.lang.String,Option>
Options. shortOpts
A map of the options with the character keyMethods in org.apache.commons.cli that return Option Modifier and Type Method Description Option
Option.Builder. build()
Constructs an Option with the values declared by thisOption.Builder
.static Option
OptionBuilder. create()
Deprecated.Creates an Option using the current settingsstatic Option
OptionBuilder. create(char opt)
Deprecated.Creates an Option using the current settings and with the specified Optionchar
.static Option
OptionBuilder. create(java.lang.String opt)
Deprecated.Creates an Option using the current settings and with the specified Optionchar
.Option
AlreadySelectedException. getOption()
Gets the option that was added to the group and triggered the exception.Option
MissingArgumentException. getOption()
Gets the option requiring an argument that wasn't provided on the command line.Option
Options. getOption(java.lang.String opt)
Gets theOption
matching the long or short name specified.Option[]
CommandLine. getOptions()
Gets an array of the processedOption
s.private Option
CommandLine. resolveOption(java.lang.String opt)
Retrieves the option object given the long or short option as a StringMethods in org.apache.commons.cli that return types with arguments of type Option Modifier and Type Method Description java.util.Comparator<Option>
HelpFormatter. getOptionComparator()
Comparator used to sort the options when they output in help text.java.util.Collection<Option>
OptionGroup. getOptions()
java.util.Collection<Option>
Options. getOptions()
Gets a read-only list of options in this set(package private) java.util.List<Option>
Options. helpOptions()
Returns the Options for use by the HelpFormatter.java.util.Iterator<Option>
CommandLine. iterator()
Returns an iterator over the Option members of CommandLine.Methods in org.apache.commons.cli with parameters of type Option Modifier and Type Method Description protected void
CommandLine. addOption(Option opt)
Adds an option to the command line.CommandLine.Builder
CommandLine.Builder. addOption(Option opt)
Adds an option to the command line.OptionGroup
OptionGroup. addOption(Option option)
Add the specifiedOption
to this group.Options
Options. addOption(Option opt)
Adds an option instanceprivate void
HelpFormatter. appendOption(java.lang.StringBuffer buff, Option option, boolean required)
Appends the usage clause for an Option to a StringBuffer.int
HelpFormatter.OptionComparator. compare(Option opt1, Option opt2)
Compares its two arguments for order.static java.lang.String
HelpFormatter. getDescription(Option option)
Gets the option description or an empty string if the description isnull
.OptionGroup
Options. getOptionGroup(Option opt)
Gets the OptionGroup theopt
belongs to.java.util.Properties
CommandLine. getOptionProperties(Option option)
Gets the map of values associated to the option.java.lang.String
CommandLine. getOptionValue(Option option)
Gets the first argument, if any, of this option.java.lang.String
CommandLine. getOptionValue(Option option, java.lang.String defaultValue)
Gets the first argument, if any, of an option.java.lang.String
CommandLine. getOptionValue(Option option, java.util.function.Supplier<java.lang.String> defaultValue)
Gets the first argument, if any, of an option.java.lang.String[]
CommandLine. getOptionValues(Option option)
Gets the array of values, if any, of an option.<T> T
CommandLine. getParsedOptionValue(Option option)
Gets a version of thisOption
converted to a particular type.<T> T
CommandLine. getParsedOptionValue(Option option, java.util.function.Supplier<T> defaultValue)
Gets a version of thisOption
converted to a particular type.<T> T
CommandLine. getParsedOptionValue(Option option, T defaultValue)
Gets a version of thisOption
converted to a particular type.private void
CommandLine. handleDeprecated(Option option)
Handles deprecated options.private void
DefaultParser. handleOption(Option option)
boolean
CommandLine. hasOption(Option opt)
Tests to see if an option has been set.void
Parser. processArgs(Option opt, java.util.ListIterator<java.lang.String> iter)
Deprecated.Process the argument values for the specified Optionopt
using the values retrieved from the specified iteratoriter
.void
OptionGroup. setSelected(Option option)
Sets the selected option of this group toname
.private void
DefaultParser. updateRequiredOptions(Option option)
Removes the option or its group from the list of expected elements.private void
Parser. updateRequiredOptions(Option opt)
Deprecated.Removes the option or its group from the list of expected elements.Method parameters in org.apache.commons.cli with type arguments of type Option Modifier and Type Method Description CommandLine.Builder
CommandLine.Builder. setDeprecatedHandler(java.util.function.Consumer<Option> deprecatedHandler)
Sets the deprecated option handler.DefaultParser.Builder
DefaultParser.Builder. setDeprecatedHandler(java.util.function.Consumer<Option> deprecatedHandler)
Sets the deprecated option handler.void
HelpFormatter. setOptionComparator(java.util.Comparator<Option> comparator)
Sets the comparator used to sort the options when they output in help text.HelpFormatter.Builder
HelpFormatter.Builder. setShowDeprecated(java.util.function.Function<Option,java.lang.String> showDeprecatedFunc)
Sets whether to show deprecated options.Constructors in org.apache.commons.cli with parameters of type Option Constructor Description AlreadySelectedException(java.lang.String message, OptionGroup group, Option option)
AlreadySelectedException(OptionGroup group, Option option)
Constructs a newAlreadySelectedException
for the specified option group.MissingArgumentException(Option option)
Constructs a newMissingArgumentException
with the specified detail message.Constructor parameters in org.apache.commons.cli with type arguments of type Option Constructor Description CommandLine(java.util.List<java.lang.String> args, java.util.List<Option> options, java.util.function.Consumer<Option> deprecatedHandler)
Creates a command line.DefaultParser(boolean allowPartialMatching, java.lang.Boolean stripLeadingAndTrailingQuotes, java.util.function.Consumer<Option> deprecatedHandler)
Creates a new DefaultParser instance with the specified partial matching and quote stripping policy.HelpFormatter(java.util.function.Function<Option,java.lang.String> deprecatedFormatFunc, java.io.PrintWriter printStream)
Constructs a new instance.
-