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

Unified Diff: pkg/analyzer_experimental/lib/options.dart

Issue 16357010: Basic dart^2 analyzer tests running. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 6 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
Index: pkg/analyzer_experimental/lib/options.dart
diff --git a/pkg/analyzer_experimental/lib/options.dart b/pkg/analyzer_experimental/lib/options.dart
index 9ada7ac4408e1d7806b432be84f80a9019187396..8c26f43ac9174a29fc35540b100d8f9c6155fbda 100644
--- a/pkg/analyzer_experimental/lib/options.dart
+++ b/pkg/analyzer_experimental/lib/options.dart
@@ -110,6 +110,8 @@ class CommandLineOptions {
defaultsTo: false, negatable: false);
try {
+ // TODO(scheglov) https://code.google.com/p/dart/issues/detail?id=11061
+ args = args.map((String arg) => arg == '-batch' ? '--batch' : arg).toList();
var results = parser.parse(args);
// help requests
if (results['help']) {
@@ -118,16 +120,16 @@ class CommandLineOptions {
}
// batch mode and input files
if (results['batch']) {
- if (results.rest.length != 0) {
+ if (results.rest.isNotEmpty) {
print('No source files expected in the batch mode.');
_showUsage(parser);
exit(15);
}
- } if (results['version']) {
+ } else if (results['version']) {
print('$_BINARY_NAME version ${_getVersion()}');
exit(0);
} else {
- if (results.rest.length == 0) {
+ if (results.rest.isEmpty) {
_showUsage(parser);
exit(15);
}
@@ -153,7 +155,6 @@ class CommandLineOptions {
Path path = new Path(new Options().script);
Path versionPath = path.directoryPath.append('..').append('version');
File versionFile = new File.fromPath(versionPath);
-
return versionFile.readAsStringSync().trim();
} catch (_) {
// This happens when the script is not running in the context of an SDK.

Powered by Google App Engine
This is Rietveld 408576698