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

Unified Diff: pkg/front_end/lib/src/fasta/command_line.dart

Issue 2718113003: Run dartfmt on pkg/front_end/lib. (Closed)
Patch Set: Rerun after merging. Created 3 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 | « pkg/front_end/lib/src/fasta/combinator.dart ('k') | pkg/front_end/lib/src/fasta/compile_platform.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/front_end/lib/src/fasta/command_line.dart
diff --git a/pkg/front_end/lib/src/fasta/command_line.dart b/pkg/front_end/lib/src/fasta/command_line.dart
index 0ef4bd9b8cdad0249b9975eb1af7ad8382ae4215..643bd923912c08a343f1cab33dd9fc4ebcb371f2 100644
--- a/pkg/front_end/lib/src/fasta/command_line.dart
+++ b/pkg/front_end/lib/src/fasta/command_line.dart
@@ -4,9 +4,7 @@
library fasta.command_line;
-import 'errors.dart' show
- inputError,
- internalError;
+import 'errors.dart' show inputError, internalError;
argumentError(String usage, String message) {
if (usage != null) print(usage);
@@ -45,8 +43,7 @@ class CommandLine {
}
/// Override to validate arguments and options.
- void validate() {
- }
+ void validate() {}
/// Parses a list of command-line [arguments] into options and arguments.
///
@@ -104,18 +101,21 @@ class CommandLine {
}
if (valueSpecification == null) {
if (value != null) {
- return argumentError(usage,
- "Argument '$argument' doesn't take a value: '$value'.");
+ return argumentError(
+ usage, "Argument '$argument' doesn't take a value: '$value'.");
}
result.options[argument] = true;
} else {
if (valueSpecification is! String && valueSpecification is! Type) {
- return argumentError(usage, "Unrecognized type of value "
+ return argumentError(
+ usage,
+ "Unrecognized type of value "
"specification: ${valueSpecification.runtimeType}.");
}
switch ("$valueSpecification") {
case ",":
- result.options.putIfAbsent(argument, () => <String>[])
+ result.options
+ .putIfAbsent(argument, () => <String>[])
.addAll(value.split(","));
break;
@@ -124,14 +124,16 @@ class CommandLine {
case "String":
case "Uri":
if (result.options.containsKey(argument)) {
- return argumentError(usage, "Multiple values for '$argument': "
+ return argumentError(
+ usage,
+ "Multiple values for '$argument': "
"'${result.options[argument]}' and '$value'.");
}
var parsedValue;
if (valueSpecification == int) {
parsedValue = int.parse(value, onError: (_) {
- return argumentError(usage,
- "Value for '$argument', '$value', isn't an int.");
+ return argumentError(
+ usage, "Value for '$argument', '$value', isn't an int.");
});
} else if (valueSpecification == bool) {
if (value == "true" || value == "yes") {
@@ -139,7 +141,8 @@ class CommandLine {
} else if (value == "false" || value == "no") {
parsedValue = false;
} else {
- return argumentError(usage,
+ return argumentError(
+ usage,
"Value for '$argument' is '$value', "
"but expected one of: 'true', 'false', 'yes', or 'no'.");
}
@@ -148,7 +151,9 @@ class CommandLine {
} else if (valueSpecification == String) {
parsedValue = value;
} else if (valueSpecification is String) {
- return argumentError(usage, "Unrecognized value specification: "
+ return argumentError(
+ usage,
+ "Unrecognized value specification: "
"'$valueSpecification', try using a type literal instead.");
} else {
// All possible cases should have been handled above.
« no previous file with comments | « pkg/front_end/lib/src/fasta/combinator.dart ('k') | pkg/front_end/lib/src/fasta/compile_platform.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698