Package org.apache.commons.cli
Apache Commons CLI provides a simple API for presenting, processing and validating a Command Line Interface.
-
Interface Summary Interface Description CommandLineParser A class that implements theCommandLineParser
interface can parse a String array according to theOptions
specified and return aCommandLine
.Converter<T,E extends java.lang.Throwable> The definition of the functional interface to call when doing a conversion. -
Class Summary Class Description BasicParser Deprecated. since 1.3, use theDefaultParser
insteadChar Package-private character constants.CommandLine Represents list of arguments parsed against aOptions
descriptor.CommandLine.Builder A nested builder class to createCommandLine
instance using descriptive methods.DefaultParser Default parser.DefaultParser.Builder A nested builder class to createDefaultParser
instances using descriptive methods.DeprecatedAttributes Deprecated attributes.DeprecatedAttributes.Builder BuildsDeprecatedAttributes
.GnuParser Deprecated. since 1.3, use theDefaultParser
insteadHelpFormatter A formatter of help messages for command line options.HelpFormatter.Builder BuildsHelpFormatter
.HelpFormatter.OptionComparator This class implements theComparator
interface for comparing Options.Option Describes a single command-line option.Option.Builder BuildsOption
instances using descriptive methods.OptionBuilder Deprecated. since 1.3, useOption.builder(String)
insteadOptionGroup A group of mutually exclusive options.Options Main entry-point into the library.OptionValidator Validates an Option string.Parser Deprecated. since 1.3, the two-pass parsing with the flatten method is not enough flexible to handle complex casesPatternOptionBuilder Allows Options to be created from a single String.PosixParser Deprecated. since 1.3, use theDefaultParser
insteadTypeHandler TypeHandler will handle the pluggable conversion and verification of Option types.Util Contains useful helper methods for classes within this package. -
Exception Summary Exception Description AlreadySelectedException Thrown when more than one option in an option group has been provided.AmbiguousOptionException Exception thrown when an option can't be identified from a partial name.MissingArgumentException Thrown when an option requiring an argument is not provided with an argument.MissingOptionException Thrown when a required option has not been provided.ParseException Base for Exceptions thrown during parsing of a command-line.UnrecognizedOptionException Thrown during parsing signaling an unrecognized option.