ArgParser.parse()
now throws an ArgParserException
, which implements FormatException
and has a field that lists the commands that were parsed.
If CommandRunner.run()
encounters a parse error for a subcommand, it now prints the subcommand's usage rather than the global usage.
CommandRunner.argParser
and Command.argParser
to be overridden in strong mode.List<String>
s.By default, only the first line of a command‘s description is included in its parent runner’s usage string. This returns to the default behavior from before 0.13.3+1.
A Command.summary
getter has been added to explicitly control the summary that appears in the parent runner's usage string. This getter defaults to the first line of the description, but can be overridden if the user wants a multi-line summary.
usage
getter in the README.allowTrailingOptions
parameter to new ArgParser()
. This doesn't change the behavior at all; the option already defaulted to false
, and passing in null
still works.getopt
, the de facto standard for option parsing.ArgParser.addSeparator()
. Separators allow users to group their options in the usage text.splitCommas
option.collection
package.Updated dependency constraint on unittest
.
Formatted source code.
Fixed use of deprecated API in example.
help
command for CommandRunner
.Add CommandRunner
and Command
classes which make it easy to build a command-based command-line application.
Add an ArgResults.arguments
field, which contains the original argument list.
ArgParser.getUsage()
with ArgParser.usage
, a getter. ArgParser.getUsage()
is now deprecated, to be removed in args version 1.0.0.collection
package.Removed public constructors for ArgResults
and Option
.
ArgResults.wasParsed()
can be used to determine if an option was actually parsed or the default value is being returned.
Replaced isFlag
and allowMultiple
fields in the Option
class with a three-value OptionType
enum.
Options may define valueHelp
which will then be shown in the usage.
ArgParser.parse()
into ArgParser
itself. This lets subcommands have different behavior for how they handle trailing options.