Index: sdk/lib/_internal/pub/lib/src/command/global_run.dart |
diff --git a/sdk/lib/_internal/pub/lib/src/command/global_run.dart b/sdk/lib/_internal/pub/lib/src/command/global_run.dart |
index 06783e5103db7cb129acaa5122b734d8988fe8a7..7fc07a7aa5792794506057705746ac7e8bb946c2 100644 |
--- a/sdk/lib/_internal/pub/lib/src/command/global_run.dart |
+++ b/sdk/lib/_internal/pub/lib/src/command/global_run.dart |
@@ -15,28 +15,28 @@ import '../utils.dart'; |
/// Handles the `global run` pub command. |
class GlobalRunCommand extends PubCommand { |
- bool get takesArguments => true; |
- bool get allowTrailingOptions => false; |
+ String get name => "run"; |
String get description => |
"Run an executable from a globally activated package.\n" |
"NOTE: We are currently optimizing this command's startup time."; |
- String get usage => "pub global run <package>:<executable> [args...]"; |
+ String get invocation => "pub global run <package>:<executable> [args...]"; |
+ bool get allowTrailingOptions => false; |
/// The mode for barback transformers. |
- BarbackMode get mode => new BarbackMode(commandOptions["mode"]); |
+ BarbackMode get mode => new BarbackMode(argResults["mode"]); |
GlobalRunCommand() { |
- commandParser.addOption("mode", defaultsTo: "release", |
+ argParser.addOption("mode", defaultsTo: "release", |
help: 'Mode to run transformers in.'); |
} |
- Future onRun() async { |
- if (commandOptions.rest.isEmpty) { |
- usageError("Must specify an executable to run."); |
+ Future run() async { |
+ if (argResults.rest.isEmpty) { |
+ usageException("Must specify an executable to run."); |
} |
var package; |
- var executable = commandOptions.rest[0]; |
+ var executable = argResults.rest[0]; |
if (executable.contains(":")) { |
var parts = split1(executable, ":"); |
package = parts[0]; |
@@ -46,11 +46,11 @@ class GlobalRunCommand extends PubCommand { |
package = executable; |
} |
- var args = commandOptions.rest.skip(1).toList(); |
+ var args = argResults.rest.skip(1).toList(); |
if (p.split(executable).length > 1) { |
// TODO(nweiz): Use adjacent strings when the new async/await compiler |
// lands. |
- usageError('Cannot run an executable in a subdirectory of a global ' + |
+ usageException('Cannot run an executable in a subdirectory of a global ' + |
'package.'); |
} |