PackageTrack
Sign in Get early access

args

Library for defining parsers for parsing raw command-line arguments into a set of options and values using GNU and POSIX style options.

2.7.0 9.8M downloads/mo #29 most downloaded on pub.dev dart-lang/core

What this package is like to depend on

Last release 1 years ago

12 Mar 2025

Release timing varies

gaps range from 3 weeks to 10 months

Some releases are documented

notes for 58 of 135 stable releases

Nothing withdrawn

no release was ever pulled

14 years old

136 releases · first in 2012

0 releases in the last 12 months

see the full history below

Release timeline

136 releases · Nov 2012 to Mar 2025
2013 2015 2017 2019 2021 2023 2025
Release Pre-release

Releases

latest 60 of 136
  1. 2.7.0 12 Mar 2025
    Release notes
    • Remove sorting of the allowedHelp argument in usage output. Ordering will
      depend on key order for the passed Map.
    • Fix the repository URL in pubspec.yaml.
    • Added option hideNegatedUsage to ArgParser.flag() allowing a flag to be
      negatable without showing it in the usage text.
    • Fixed #101, adding check for mandatory when using .option().
    Open source →
    Release notes
    • Remove sorting of the allowedHelp argument in usage output. Ordering will depend on key order for the passed Map.
    • Fix the repository URL in pubspec.yaml.
    • Added option hideNegatedUsage to ArgParser.flag() allowing a flag to be negatable without showing it in the usage text.
    • Fixed #101, adding check for mandatory when using .option().
    Open source →
  2. 2.6.0 14 Oct 2024
    Release notes
    • Added source argument when throwing a ArgParserException.
    • Fix inconsistent FormatException messages
    • Require Dart 3.3
    • Move to dart-lang/core monorepo.
    Open source →
  3. 2.5.0 11 Apr 2024
    Release notes
    • Introduce new typed ArgResults flag(String), option(String), and multiOption(String) methods.
    • Require Dart 3.0.
    Open source →
  4. 2.4.2 05 Jun 2023
    Release notes
    • Change the validation of mandatory options; they now perform validation when the value is retrieved (from the ArgResults object), instead of when the args are parsed.
    • Require Dart 2.19.
    Open source →
  5. 2.4.1 03 May 2023
    Release notes
    • Add a CONTRIBUTING.md file; move the publishing automation docs from the readme into the contributing doc.
    • Added package topics to the pubspec file.
    Open source →
  6. 2.4.0 10 Feb 2023
    Release notes
    • Command suggestions will now also suggest based on aliases of a command.
    • Introduce getter Command.suggestionAliases for names that cannot be used as aliases, but will trigger suggestions.
    Open source →
  7. 2.3.2 19 Jan 2023
    Release notes
    • Require Dart 2.18
    Open source →
  8. 2.3.1 11 May 2022
    Release notes
    • Switch to using package:lints.
    • Address an issue with the readme API documentation (#211).
    • Populate the pubspec repository field.
    Open source →
  9. 2.3.0 13 Sep 2021
    Release notes
    • Add the ability to group commands by category in usage text.
    Open source →
  10. 2.2.0 22 Jul 2021
    Release notes
    • Suggest similar commands if an unknown command is encountered, when using the CommandRunner.
      • The max edit distance for suggestions defaults to 2, but can be configured using the suggestionDistanceLimit parameter on the constructor. You can set it to 0 to disable the feature.
    Open source →
  11. 2.1.1 01 Jun 2021
    Release notes
    • Fix a bug with mandatory options which caused a null assertion failure when used within a command.
    Open source →
  12. 2.1.0 22 Apr 2021
    Release notes
    • Add a mandatory argument to require the presence of an option.
    • Add 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.
    Open source →
  13. 2.0.0 05 Feb 2021
    Release notes
    • Stable null safety release.
    Open source →
  14. 2.0.0-nullsafety.0 30 Dec 2020 pre-release
    Release notes
    • Migrate to null safety.

    • BREAKING Remove APIs that had been marked as deprecated:

      • Instead of the allowMulti and splitCommas arguments to ArgParser.addOption(), use ArgParser.addMultiOption().
      • Instead of ArgParser.getUsage(), use ArgParser.usage.
      • Instead of Option.abbreviation, use Option.abbr.
      • Instead of Option.defaultValue, use Option.defaultsTo.
      • Instead of OptionType.FLAG/SINGLE/MULTIPLE, use OptionType.flag/single/multiple.
    • Add a more specific function type to the callback argument of addOption.

    Open source →
  15. 1.6.0 17 Mar 2020
    Release notes
    • Remove help from the list of commands in usage.
    • Remove the blank lines in usage which separated the help for options that happened to span multiple lines.
    Open source →
  16. 1.5.4 16 Mar 2020
    Release notes
    • Fix a bug with option names containing underscores.
    • Point towards CommandRunner in the docs for ArgParser.addCommand since it is what most authors will want to use instead.
    Open source →
  17. 1.5.3 28 Feb 2020
    Release notes
    • Improve arg parsing performance: use queues instead of lists internally to get linear instead of quadratic performance, which is important for large numbers of args (>1000). And, use simple string manipulation instead of regular expressions for a 1.5x improvement everywhere.
    • No longer automatically add a 'help' option to commands that don't validate their arguments (fix #123).
    Open source →
  18. 1.5.2 31 May 2019
    Release notes
    • Added support for usageLineLength in CommandRunner
    Open source →
  19. 1.5.1 08 Nov 2018
    Release notes
    • Added more comprehensive word wrapping when usageLineLength is set.
    Open source →
  20. 1.5.0 02 Aug 2018
    Release notes
    • Add usageLineLength to control word wrapping usage text.
    Open source →
  21. 1.4.4 18 Jul 2018
    Release notes
    • Set max SDK version to <3.0.0, and adjust other dependencies.
    Open source →
  22. 1.4.3 24 Apr 2018
    Release notes
    • Display the default values for options with allowedHelp specified.
    Open source →
  23. 1.4.2 09 Apr 2018
    Release notes
    • Narrow the SDK constraint to only allow SDK versions that support FutureOr.
    Open source →
  24. 1.4.1 23 Feb 2018
    Release notes
    • Run dart format with the new style.
    • Performance improvement for non-BMP characters.
    Open source →
    Release notes
    • Fix the way default values for multi-valued options are printed in argument usage.
    Open source →
  25. 1.4.0 22 Feb 2018
    Release notes
    • 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.

    Open source →
  26. 1.3.0 26 Jan 2018
    Release notes
    • Type Command.run()'s return value as FutureOr<T>.
    Open source →
  27. 1.2.0 06 Dec 2017
    Release notes
    • Type the 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).
    Open source →
  28. 1.1.0 27 Nov 2017
    Release notes
    • 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>.

    Open source →
  29. 1.0.2 19 Oct 2017
    Release notes
    • Fix analyzer warning
    Open source →
  30. 1.0.1 03 Oct 2017
    Release notes
    • Fix a fuzzy arrow type warning.
    Open source →
  31. 1.0.0 14 Jun 2017
    Release notes
    • 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.

    Open source →
  32. 0.13.7 11 Nov 2016
    Release notes
    • 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.

    Open source →
  33. 0.13.6 30 Sep 2016
    Release notes
    • 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.

    Open source →
  34. 0.13.6+1 07 Nov 2016
    Release notes
    • When a CommandRunner is passed --help before any commands, it now prints the usage of the chosen command.
    Open source →
  35. 0.13.5 22 Jul 2016
    Release notes
    • Allow CommandRunner.argParser and Command.argParser to be overridden in strong mode.
    Open source →
  36. 0.13.4 17 Mar 2016
    Release notes
    • 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.

    Open source →
  37. 0.13.4+1 05 May 2016
    Release notes
    • Ensure that multiple-value arguments produce reified List<String>s.
    Open source →
  38. 0.13.4+2 16 May 2016
    Release notes
    • Fix a minor documentation error.
    Open source →
  39. 0.13.3+1 20 Jan 2016
    Release notes
    • Print all lines of multi-line command descriptions.
    Open source →
  40. 0.13.3+2 02 Feb 2016
    Release notes
    • Documentation fixes.
    Open source →
  41. 0.13.3+3 08 Feb 2016
    Release notes
    • Add an explicit default value for the 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.
    Open source →
  42. 0.13.3+4 29 Feb 2016
    Release notes
    • Use the proper usage getter in the README.
    Open source →
  43. 0.13.3+6 05 Mar 2016
    Release notes
    • README fixes.
    Open source →
  44. 0.13.2 09 Jun 2015
    Release notes
    • Allow option values that look like options. This more closely matches the behavior of getopt, the de facto standard for option parsing.
    Open source →
  45. 0.13.1 21 May 2015
    Release notes
    • Add ArgParser.addSeparator(). Separators allow users to group their options in the usage text.
    Open source →
  46. 0.13.0 05 Mar 2015
    Release notes
    • Breaking change: An option that allows multiple values will now automatically split apart comma-separated values. This can be controlled with the splitCommas option.
    Open source →
  47. 0.12.2 17 Dec 2014
    Release notes
    • 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.

    Open source →
  48. 0.12.2+1 17 Dec 2014
    Release notes
    • Fix the built-in help command for CommandRunner.
    Open source →
  49. 0.12.2+2 14 Jan 2015
    Release notes
    • Updated dependency constraint on unittest.

    • Formatted source code.

    • Fixed use of deprecated API in example.

    Open source →
  50. 0.12.2+3 23 Jan 2015
    Release notes
    • Fixed implementation of ArgResults.options to really use Iterable<String> instead of Iterable<dynamic> cast to Iterable<String>.
    Open source →
  51. 0.12.2+4 11 Feb 2015
    Release notes
    • Add an example of using command-line arguments to the README.
    Open source →
  52. 0.12.2+5 17 Feb 2015
    Release notes
    • Add syntax highlighting to the README.
    Open source →
  53. 0.12.2+6 18 Feb 2015
    Release notes
    • Remove the dependency on the collection package.
    Open source →
  54. 0.12.1 31 Oct 2014
    Release notes
    • Replace ArgParser.getUsage() with ArgParser.usage, a getter. ArgParser.getUsage() is now deprecated, to be removed in args version 1.0.0.
    Open source →
  55. 0.12.0 17 Jul 2014
    Release notes
    • 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.

    Open source →
  56. 0.12.0+1 24 Jul 2014
    Release notes
    • Remove the documentation link from the pubspec so this is linked to pub.dev by default.
    Open source →
  57. 0.12.0+2 26 Aug 2014
    Release notes
    • Widen the version constraint on the collection package.
    Open source →
  58. 0.11.0 06 May 2014
    Release notes
    • Move handling trailing options from ArgParser.parse() into ArgParser itself. This lets subcommands have different behavior for how they handle trailing options.
    Open source →
  59. 0.11.0+1 12 May 2014

    Nothing published for this version

  60. 0.10.0 11 Dec 2013

    Nothing published for this version

Every package, every release, already written down.

The archive is open and free. Watching your own project is what we are building next.

Browse the archive