Allow command ArgParsers to be overridden.
This didn't work in strong mode, since they were declared as fields.
R=rnystrom@google.com
Review URL: https://codereview.chromium.org//2173623002 .
diff --git a/CHANGELOG.md b/CHANGELOG.md
index cbbe463..0861e19 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,8 @@
+## 0.13.5
+
+* Allow `CommandRunner.argParser` and `Command.argParser` to be overridden in
+ strong mode.
+
## 0.13.4+2
* Fix a minor documentation error.
diff --git a/lib/command_runner.dart b/lib/command_runner.dart
index 1e33965..21dfa32 100644
--- a/lib/command_runner.dart
+++ b/lib/command_runner.dart
@@ -67,7 +67,8 @@
/// Global options should be registered with this parser; they'll end up
/// available via [Command.globalResults]. Commands should be registered with
/// [addCommand] rather than directly on the parser.
- final argParser = new ArgParser();
+ ArgParser get argParser => _argParser;
+ final _argParser = new ArgParser();
CommandRunner(this.executableName, this.description) {
argParser.addFlag('help',
@@ -249,7 +250,8 @@
/// the constructor); they'll end up available via [argResults]. Subcommands
/// should be registered with [addSubcommand] rather than directly on the
/// parser.
- final argParser = new ArgParser();
+ ArgParser get argParser => _argParser;
+ final _argParser = new ArgParser();
/// Generates a string displaying usage information for this command.
///
diff --git a/pubspec.yaml b/pubspec.yaml
index 4f5fb7f..e52bf29 100644
--- a/pubspec.yaml
+++ b/pubspec.yaml
@@ -1,5 +1,5 @@
name: args
-version: 0.13.4+2
+version: 0.13.5
author: "Dart Team <misc@dartlang.org>"
homepage: https://github.com/dart-lang/args
description: >