args 1.4.2
args: ^1.4.2 copied to clipboard
Library for defining parsers for parsing raw command-line arguments into a set of options and values using GNU and POSIX style options.
1.4.2 #
- Narrow the SDK constraint to only allow SDK versions that support
FutureOr.
1.4.1 #
- Fix the way default values for multi-valued options are printed in argument usage.
1.4.0 #
-
Deprecated
OptionType.FLAG,OptionType.SINGLE, andOptionType.MULTIPLEin favor ofOptionType.flag,OptionType.single, andOptionType.multiplewhich follow the style guide. -
Deprecated
Option.abbreviationandOption.defaultValuein favor ofOption.abbrandOption.defaultsTo. This makes all ofOption's fields match the corresponding parameters toArgParser.addOption(). -
Deprecated the
allowMultipleandsplitCommasarguments toArgParser.addOption()in favor of a separateArgParser.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.
1.3.0 #
- Type
Command.run()'s return value asFutureOr<T>.
1.2.0 #
- Type the
callbackparameter toArgParser.addOption()asFunctionrather thanvoid Function(value). This allows strong-mode users to writecallback: (String value) { ... }rather than having to manually castvalueto aString(or aList<String>withallowMultiple: true).
1.1.0 #
-
ArgParser.parse()now takes anIterable<String>rather than aList<String>. -
ArgParser.addOption()'sallowedoption now takes anIterable<String>rather than aList<String>.
1.0.2 #
- Fix analyzer warning
1.0.1 #
- Fix a fuzzy arrow type warning.
1.0.0 #
-
Breaking change: The
allowTrailingOptionsargument tonew ArgumentParser()defaults totrueinstead offalse. -
Add
new ArgParser.allowAnything(). This allows any input, without parsing any options.
0.13.7 #
-
Add explicit support for forwarding the value returned by
Command.run()toCommandRunner.run(). This worked unintentionally prior to 0.13.6+1. -
Add type arguments to
CommandRunnerandCommandto indicate the return values of therun()functions.
0.13.6+1 #
- When a
CommandRunneris passed--helpbefore any commands, it now prints the usage of the chosen command.
0.13.6 #
-
ArgParser.parse()now throws anArgParserException, which implementsFormatExceptionand 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.
0.13.5 #
- Allow
CommandRunner.argParserandCommand.argParserto be overridden in strong mode.
0.13.4+2 #
- Fix a minor documentation error.
0.13.4+1 #
- Ensure that multiple-value arguments produce reified
List<String>s.
0.13.4 #
-
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.summarygetter 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.
0.13.3+6 #
- README fixes.
0.13.3+5 #
- Make strong mode clean.
0.13.3+4 #
- Use the proper
usagegetter in the README.
0.13.3+3 #
- Add an explicit default value for the
allowTrailingOptionsparameter tonew ArgParser(). This doesn't change the behavior at all; the option already defaulted tofalse, and passing innullstill works.
0.13.3+2 #
- Documentation fixes.
0.13.3+1 #
- Print all lines of multi-line command descriptions.
0.13.2 #
- Allow option values that look like options. This more closely matches the
behavior of
getopt, the de facto standard for option parsing.
0.13.1 #
- Add
ArgParser.addSeparator(). Separators allow users to group their options in the usage text.
0.13.0 #
- Breaking change: An option that allows multiple values will now
automatically split apart comma-separated values. This can be controlled with
the
splitCommasoption.
0.12.2+6 #
- Remove the dependency on the
collectionpackage.
0.12.2+5 #
- Add syntax highlighting to the README.
0.12.2+4 #
- Add an example of using command-line arguments to the README.
0.12.2+3 #
- Fixed implementation of ArgResults.options to really use Iterable
0.12.2+2 #
-
Updated dependency constraint on
unittest. -
Formatted source code.
-
Fixed use of deprecated API in example.
0.12.2+1 #
- Fix the built-in
helpcommand forCommandRunner.
0.12.2 #
-
Add
CommandRunnerandCommandclasses which make it easy to build a command-based command-line application. -
Add an
ArgResults.argumentsfield, which contains the original argument list.
0.12.1 #
- Replace
ArgParser.getUsage()withArgParser.usage, a getter.ArgParser.getUsage()is now deprecated, to be removed in args version 1.0.0.
0.12.0+2 #
- Widen the version constraint on the
collectionpackage.
0.12.0+1 #
- Remove the documentation link from the pubspec so this is linked to pub.flutter-io.cn by default.
0.12.0 #
-
Removed public constructors for
ArgResultsandOption. -
ArgResults.wasParsed()can be used to determine if an option was actually parsed or the default value is being returned. -
Replaced
isFlagandallowMultiplefields in theOptionclass with a three-valueOptionTypeenum. -
Options may define
valueHelpwhich will then be shown in the usage.
0.11.0 #
- Move handling trailing options from
ArgParser.parse()intoArgParseritself. This lets subcommands have different behavior for how they handle trailing options.
0.10.0+2 #
- Usage ignores hidden options when determining column widths.