NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
pub.dev · #38 most downloaded on pub.dev
Library for defining parsers for parsing raw command-line arguments into a set of options and values using GNU and POSIX style options.
Last release 2 years ago
no release in 18 months
Release timing varies
gaps range from 3 weeks to 10 months
Nearly every release is documented
notes for 58 of the last 60 stable releases
Nothing withdrawn
no release was ever pulled
14 years old
136 releases · first in 2012
Remove sorting of the allowedHelp argument in usage output. Ordering will depend on key order for the passed Map .
allowedHelp argument in usage output. Ordering willMap.pubspec.yaml.hideNegatedUsage to ArgParser.flag() allowing a flag to benegatable without showing it in the usage text..option().Added source argument when throwing a ArgParserException.
ArgParserException.FormatException messagesdart-lang/core monorepo.One column per quarter.
Introduce new typed ArgResults flag(String), option(String), and multiOption(String) methods.
ArgResults flag(String), option(String), and
multiOption(String) methods.Change the validation of mandatory options; they now perform validation when the value is retrieved (from the ArgResults object), instead of when the
mandatory options; they now perform validation when
the value is retrieved (from the ArgResults object), instead of when the
args are parsed.Add a CONTRIBUTING.md file; move the publishing automation docs from the readme into the contributing doc.
CONTRIBUTING.md file; move the publishing automation docs from the
readme into the contributing doc.Command suggestions will now also suggest based on aliases of a command.
Command.suggestionAliases for names that cannot be used as
aliases, but will trigger suggestions.* Require Dart 2.18
Address an issue with the readme API documentation (#211).
repository field.Add the ability to group commands by category in usage text.
Suggest similar commands if an unknown command is encountered, when using the CommandRunner.
CommandRunner.
suggestionDistanceLimit parameter on the constructor. You can
set it to 0 to disable the feature.Fix a bug with mandatory options which caused a null assertion failure when used within a command.
mandatory options which caused a null assertion failure when
used within a command.Add a mandatory argument to require the presence of an option.
mandatory argument to require the presence of an option.aliases named argument to addFlag, addOption, and addMultiOption,
as well as a public findByNameOrAlias method on ArgParser. This allows
you to provide aliases for an argument name, which eases the transition from
one argument name to another.* Stable null safety release.
BREAKING Remove APIs that had been marked as deprecated:
Migrate to null safety.
BREAKING Remove APIs that had been marked as deprecated:
allowMulti and splitCommas arguments to
ArgParser.addOption(), use ArgParser.addMultiOption().ArgParser.getUsage(), use ArgParser.usage.Option.abbreviation, use Option.abbr.Option.defaultValue, use Option.defaultsTo.OptionType.FLAG/SINGLE/MULTIPLE, use
OptionType.flag/single/multiple.Add a more specific function type to the callback argument of addOption.
Remove help from the list of commands in usage.
help from the list of commands in usage.Fix a bug with option names containing underscores.
CommandRunner in the docs for ArgParser.addCommand since it
is what most authors will want to use instead.Improve arg parsing performance: use queues instead of lists internally to get linear instead of quadratic performance, which is important for large n
Added support for usageLineLength in CommandRunner
usageLineLength in CommandRunnerAdded more comprehensive word wrapping when usageLineLength is set.
usageLineLength is set.Add usageLineLength to control word wrapping usage text.
usageLineLength to control word wrapping usage text.Set max SDK version to <3.0.0, and adjust other dependencies.
<3.0.0, and adjust other dependencies.Display the default values for options with allowedHelp specified.
allowedHelp specified.Narrow the SDK constraint to only allow SDK versions that support FutureOr.
FutureOr.Run dart format with the new style.
dart format with the new style.Deprecated OptionType.FLAG, OptionType.SINGLE, and OptionType.MULTIPLE in favor of OptionType.flag, OptionType.single, and OptionType.multiple which f…
Deprecated OptionType.FLAG, OptionType.SINGLE, and OptionType.MULTIPLE
in favor of OptionType.flag, OptionType.single, and OptionType.multiple
which follow the style guide.
Deprecated Option.abbreviation and Option.defaultValue in favor of
Option.abbr and Option.defaultsTo. This makes all of Option's fields
match the corresponding parameters to ArgParser.addOption().
Deprecated the allowMultiple and splitCommas arguments to
ArgParser.addOption() in favor of a separate ArgParser.addMultiOption()
method. This allows us to provide more accurate type information, and to avoid
adding flags that only make sense for multi-options in places where they might
be usable for single-value options.
Type Command.run()'s return value as FutureOr .
Command.run()'s return value as FutureOr<T>.Type the callback parameter to ArgParser.addOption() as Function rather than void Function(value). This allows strong-mode users to write callback: (S
callback parameter to ArgParser.addOption() as Function rather
than void Function(value). This allows strong-mode users to write callback: (String value) { ... } rather than having to manually cast value to a
String (or a List<String> with allowMultiple: true).ArgParser.parse() now takes an Iterable rather than a List .
ArgParser.parse() now takes an Iterable<String> rather than a
List<String>.
ArgParser.addOption()'s allowed option now takes an Iterable<String>
rather than a List<String>.
* Fix analyzer warning
Fix a fuzzy arrow type warning.
Breaking change: The allowTrailingOptions argument to new ArgumentParser() defaults to true instead of false.
Breaking change: The allowTrailingOptions argument to new ArgumentParser() defaults to true instead of false.
Add new ArgParser.allowAnything(). This allows any input, without parsing
any options.
Add explicit support for forwarding the value returned by Command.run() to CommandRunner.run(). This worked unintentionally prior to 0.13.6+1.
Add explicit support for forwarding the value returned by Command.run() to
CommandRunner.run(). This worked unintentionally prior to 0.13.6+1.
Add type arguments to CommandRunner and Command to indicate the return
values of the run() functions.
ArgParser.parse() now throws an ArgParserException, which implements FormatException and has a field that lists the commands that were parsed.
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.
When a CommandRunner is passed --help before any commands, it now prints the usage of the chosen command.
CommandRunner is passed --help before any commands, it now prints
the usage of the chosen command.Allow CommandRunner.argParser and Command.argParser to be overridden in strong mode.
CommandRunner.argParser and Command.argParser to be overridden in
strong mode.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
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.
Ensure that multiple-value arguments produce reified List s.
List<String>s.Fix a minor documentation error.
Print all lines of multi-line command descriptions.
* Documentation fixes.
Add an explicit default value for the allowTrailingOptions parameter to new ArgParser(). This doesn't change the behavior at all; the option already d
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.Use the proper usage getter in the README.
usage getter in the README.* README fixes.
Allow option values that look like options. This more closely matches the behavior of [getopt][getopt], the *de facto* standard for option parsing.
getopt, the de facto standard for option parsing.Add ArgParser.addSeparator(). Separators allow users to group their options in the usage text.
ArgParser.addSeparator(). Separators allow users to group their options
in the usage text.Breaking change: An option that allows multiple values will now automatically split apart comma-separated values. This can be controlled with the spli…
splitCommas option.Add CommandRunner and Command classes which make it easy to build a command-based command-line application.
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.
Fix the built-in help command for CommandRunner.
help command for CommandRunner.Fixed use of deprecated API in example.
Updated dependency constraint on unittest.
Formatted source code.
Fixed use of deprecated API in example.
Fixed implementation of ArgResults.options to really use Iterable instead of Iterable cast to Iterable .
Add an example of using command-line arguments to the README.
Add syntax highlighting to the README.
Remove the dependency on the collection package.
collection package.Replace ArgParser.getUsage() with ArgParser.usage, a getter. ArgParser.getUsage() is now deprecated, to be removed in args version 1.0.0.
ArgParser.getUsage() with ArgParser.usage, a getter.
ArgParser.getUsage() is now deprecated, to be removed in args version 1.0.0.Removed public constructors for ArgResults and Option.
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.
Remove the documentation link from the pubspec so this is linked to pub.dev by default.
Widen the version constraint on the collection package.
collection package.Move handling trailing options from ArgParser.parse() into ArgParser itself. This lets subcommands have different behavior for how they handle trailin
ArgParser.parse() into ArgParser
itself. This lets subcommands have different behavior for how they handle
trailing options.Nothing published for this version
Nothing published for this version
Your coding agent can read these notes before it upgrades. Set up the MCP server →