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

Unified Diff: tools/testing/dart/test_options.dart

Issue 9091006: Allow using '--option value' as well as '--option=value' in dart test script. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 12 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/testing/dart/test_options.dart
diff --git a/tools/testing/dart/test_options.dart b/tools/testing/dart/test_options.dart
index e49d4d2bfa6d4a66db0fd398ac858cfe512aaf44..0d6e72104c2ba26b03e0ae059a0104ef2aabc10f 100644
--- a/tools/testing/dart/test_options.dart
+++ b/tools/testing/dart/test_options.dart
@@ -184,7 +184,14 @@ is 'dart file.dart' and you specify special command
var split = arg.lastIndexOf('=');
if (split == -1) {
name = arg;
- value = '';
+ // Boolean options do not have a value.
+ if (_getSpecification(name).type != 'bool') {
+ if ((i + 1) >= arguments.length) {
+ print('No value supplied for option $name');
+ return null;
+ }
+ value = arguments[++i];
+ }
} else {
name = arg.substring(0, split);
value = arg.substring(split + 1, arg.length);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698