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

Unified Diff: lib/command_runner.dart

Issue 1748333005: Make it strong mode clean. (Closed) Base URL: https://github.com/dart-lang/args.git@master
Patch Set: Created 4 years, 10 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') | lib/src/arg_parser.dart » ('j') | lib/src/parser.dart » ('J')
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 df1dbf86f1458a0addb9c5a3615dab3422e346e1..3cc952ec63bf6d90658b8f4eae24f9d0852f8ca4 100644
--- a/lib/command_runner.dart
+++ b/lib/command_runner.dart
@@ -40,7 +40,7 @@ class CommandRunner {
///
/// If a subclass overrides this to return a string, it will automatically be
/// added to the end of [usage].
- final String usageFooter = null;
+ String get usageFooter => null;
nweiz 2016/03/02 23:58:54 I thought we agreed to stop arguing about finals v
Bob Nystrom 2016/03/03 00:19:08 This is being overridden in subclasses, so making
/// Returns [usage] with [description] removed from the beginning.
String get _usageWithoutDescription {
@@ -60,7 +60,7 @@ Run "$executableName help <command>" for more information about a command.''';
/// An unmodifiable view of all top-level commands defined for this runner.
Map<String, Command> get commands => new UnmodifiableMapView(_commands);
- final _commands = new Map<String, Command>();
+ final _commands = <String, Command>{};
/// The top-level argument parser.
///
@@ -129,7 +129,7 @@ Run "$executableName help <command>" for more information about a command.''';
return new Future.sync(() {
var argResults = topLevelResults;
var commands = _commands;
- var command;
+ Command command;
var commandString = executableName;
while (commands.isNotEmpty) {
@@ -255,7 +255,7 @@ abstract class Command {
///
/// If a subclass overrides this to return a string, it will automatically be
/// added to the end of [usage].
- final String usageFooter = null;
+ String get usageFooter => null;
/// Returns [usage] with [description] removed from the beginning.
String get _usageWithoutDescription {
@@ -281,7 +281,7 @@ abstract class Command {
/// An unmodifiable view of all sublevel commands of this command.
Map<String, Command> get subcommands => new UnmodifiableMapView(_subcommands);
- final _subcommands = new Map<String, Command>();
+ final _subcommands = <String, Command>{};
/// Whether or not this command should be hidden from help listings.
///
@@ -306,7 +306,7 @@ abstract class Command {
///
/// This is intended to be overridden by commands that don't want to receive
/// arguments. It has no effect for branch commands.
- final takesArguments = true;
+ bool get takesArguments => true;
/// Alternate names for this command.
///
@@ -314,7 +314,7 @@ abstract class Command {
/// invoked on the command line.
///
/// This is intended to be overridden.
- final aliases = const <String>[];
+ List<String> get aliases => const [];
Command() {
argParser.addFlag('help',
« no previous file with comments | « CHANGELOG.md ('k') | lib/src/arg_parser.dart » ('j') | lib/src/parser.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698