Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(400)

Unified Diff: lib/command_runner.dart

Issue 2173623002: Allow command ArgParsers to be overridden. (Closed) Base URL: git@github.com:dart-lang/args@master
Patch Set: Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « CHANGELOG.md ('k') | pubspec.yaml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/command_runner.dart
diff --git a/lib/command_runner.dart b/lib/command_runner.dart
index 1e33965cc0b55cacdd59640ef324bf21a2c21653..21dfa32d842f4b349be0b42b2e093bf60063e95a 100644
--- a/lib/command_runner.dart
+++ b/lib/command_runner.dart
@@ -67,7 +67,8 @@ Run "$executableName help <command>" for more information about a command.''';
/// 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 @@ abstract class Command {
/// 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.
///
« no previous file with comments | « CHANGELOG.md ('k') | pubspec.yaml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698