Index: sdk/lib/_internal/pub_generated/lib/src/command/barback.dart |
diff --git a/sdk/lib/_internal/pub_generated/lib/src/command/barback.dart b/sdk/lib/_internal/pub_generated/lib/src/command/barback.dart |
index 556eb148c50919e107cc153fda0be175614f264a..5fdc519b6abbe369bd9e96a99addbb0489daecf3 100644 |
--- a/sdk/lib/_internal/pub_generated/lib/src/command/barback.dart |
+++ b/sdk/lib/_internal/pub_generated/lib/src/command/barback.dart |
@@ -23,10 +23,8 @@ final _allSourceDirectories = |
/// Shared base class for [BuildCommand] and [ServeCommand]. |
abstract class BarbackCommand extends PubCommand { |
- final takesArguments = true; |
- |
/// The build mode. |
- BarbackMode get mode => new BarbackMode(commandOptions["mode"]); |
+ BarbackMode get mode => new BarbackMode(argResults["mode"]); |
/// The directories in the entrypoint package that should be added to the |
/// build environment. |
@@ -40,24 +38,24 @@ abstract class BarbackCommand extends PubCommand { |
List<String> get defaultSourceDirectories; |
BarbackCommand() { |
- commandParser.addOption( |
+ argParser.addOption( |
"mode", |
defaultsTo: defaultMode.toString(), |
help: "Mode to run transformers in."); |
- commandParser.addFlag( |
+ argParser.addFlag( |
"all", |
help: "Use all default source directories.", |
defaultsTo: false, |
negatable: false); |
} |
- Future onRun() { |
+ Future run() { |
// Switch to JSON output if specified. We need to do this before parsing |
// the source directories so an error will be correctly reported in JSON |
// format. |
- log.json.enabled = commandOptions.options.contains("format") && |
- commandOptions["format"] == "json"; |
+ log.json.enabled = |
+ argResults.options.contains("format") && argResults["format"] == "json"; |
_parseSourceDirectories(); |
return onRunTransformerCommand(); |
@@ -78,18 +76,18 @@ abstract class BarbackCommand extends PubCommand { |
/// |
/// Throws an exception if the arguments are invalid. |
void _parseSourceDirectories() { |
- if (commandOptions["all"]) { |
+ if (argResults["all"]) { |
_addAllDefaultSources(); |
return; |
} |
// If no directories were specified, use the defaults. |
- if (commandOptions.rest.isEmpty) { |
+ if (argResults.rest.isEmpty) { |
_addDefaultSources(); |
return; |
} |
- sourceDirectories.addAll(commandOptions.rest); |
+ sourceDirectories.addAll(argResults.rest); |
// Prohibit "lib". |
var disallowed = sourceDirectories.where((dir) { |
@@ -98,13 +96,14 @@ abstract class BarbackCommand extends PubCommand { |
}); |
if (disallowed.isNotEmpty) { |
- usageError(_directorySentence(disallowed, "is", "are", "not allowed")); |
+ usageException( |
+ _directorySentence(disallowed, "is", "are", "not allowed")); |
} |
// Make sure the source directories don't reach out of the package. |
var invalid = sourceDirectories.where((dir) => !path.isWithin('.', dir)); |
if (invalid.isNotEmpty) { |
- usageError( |
+ usageException( |
_directorySentence(invalid, "isn't", "aren't", "in this package")); |
} |
@@ -130,7 +129,7 @@ abstract class BarbackCommand extends PubCommand { |
} |
if (overlapping.isNotEmpty) { |
- usageError( |
+ usageException( |
_directorySentence(overlapping, "cannot", "cannot", "overlap")); |
} |
} |
@@ -138,8 +137,8 @@ abstract class BarbackCommand extends PubCommand { |
/// Handles "--all" by adding all default source directories that are |
/// present. |
void _addAllDefaultSources() { |
- if (commandOptions.rest.isNotEmpty) { |
- usageError('Directory names are not allowed if "--all" is passed.'); |
+ if (argResults.rest.isNotEmpty) { |
+ usageException('Directory names are not allowed if "--all" is passed.'); |
} |
// Include every build directory that exists in the package. |