Uses of Class
org.apache.commons.cli.Option
-
Uses of Option in org.apache.commons.cli
Modifier and TypeFieldDescriptionprotected Option
DefaultParser.currentOption
The last option parsed.Modifier and TypeFieldDescriptionprotected Comparator<Option>
HelpFormatter.optionComparator
Comparator used to sort the options when they output in help text Defaults to case-insensitive alphabetical sorting by option keyModifier and TypeMethodDescriptionOption.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
Deprecated.Creates an Option using the current settings and with the specified Optionchar
.AlreadySelectedException.getOption()
Gets the option that was added to the group and triggered the exception.MissingArgumentException.getOption()
Gets the option requiring an argument that wasn't provided on the command line.Gets theOption
matching the long or short name specified.Option[]
CommandLine.getOptions()
Gets an array of the processedOption
s.Modifier and TypeMethodDescriptionHelpFormatter.getOptionComparator()
Comparator used to sort the options when they output in help text.OptionGroup.getOptions()
Options.getOptions()
Gets a read-only list of options in this setCommandLine.iterator()
Returns an iterator over the Option members of CommandLine.Modifier and TypeMethodDescriptionprotected void
Adds an option to the command line.Adds an option to the command line.Add the specifiedOption
to this group.Adds an option instancestatic String
HelpFormatter.getDescription
(Option option) Gets the option description or an empty string if the description isnull
.Options.getOptionGroup
(Option opt) Gets the OptionGroup theopt
belongs to.CommandLine.getOptionProperties
(Option option) Gets the map of values associated to the option.CommandLine.getOptionValue
(Option option) Gets the first argument, if any, of this option.CommandLine.getOptionValue
(Option option, String defaultValue) Gets the first argument, if any, of an option.CommandLine.getOptionValue
(Option option, Supplier<String> defaultValue) Gets the first argument, if any, of an option.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, 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.boolean
Tests to see if an option has been set.void
Parser.processArgs
(Option opt, ListIterator<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
.Modifier and TypeMethodDescriptionCommandLine.Builder.setDeprecatedHandler
(Consumer<Option> deprecatedHandler) Sets the deprecated option handler.DefaultParser.Builder.setDeprecatedHandler
(Consumer<Option> deprecatedHandler) Sets the deprecated option handler.void
HelpFormatter.setOptionComparator
(Comparator<Option> comparator) Sets the comparator used to sort the options when they output in help text.HelpFormatter.Builder.setShowDeprecated
(Function<Option, String> showDeprecatedFunc) Sets whether to show deprecated options.ModifierConstructorDescriptionAlreadySelectedException
(OptionGroup group, Option option) Constructs a newAlreadySelectedException
for the specified option group.MissingArgumentException
(Option option) Constructs a newMissingArgumentException
with the specified detail message.