| OLD | NEW |
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 library analyzer_cli.src.options; | 5 library analyzer_cli.src.options; |
| 6 | 6 |
| 7 import 'dart:io'; | 7 import 'dart:io'; |
| 8 | 8 |
| 9 import 'package:analyzer/file_system/physical_file_system.dart'; | 9 import 'package:analyzer/file_system/physical_file_system.dart'; |
| 10 import 'package:analyzer/src/command_line/arguments.dart'; | 10 import 'package:analyzer/src/command_line/arguments.dart'; |
| (...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 243 options.packageConfigPath != null) { | 243 options.packageConfigPath != null) { |
| 244 printAndFail("Cannot specify both '--package-root' and '--packages."); | 244 printAndFail("Cannot specify both '--package-root' and '--packages."); |
| 245 return null; // Only reachable in testing. | 245 return null; // Only reachable in testing. |
| 246 } | 246 } |
| 247 } | 247 } |
| 248 | 248 |
| 249 // Build mode. | 249 // Build mode. |
| 250 if (options.buildModePersistentWorker && !options.buildMode) { | 250 if (options.buildModePersistentWorker && !options.buildMode) { |
| 251 printAndFail('The option --persisten_worker can be used only ' | 251 printAndFail('The option --persisten_worker can be used only ' |
| 252 'together with --build-mode.'); | 252 'together with --build-mode.'); |
| 253 return null; // Only reachable in testing. |
| 253 } | 254 } |
| 254 if (options.buildSummaryOnlyDiet && !options.buildSummaryOnly) { | 255 if (options.buildSummaryOnlyDiet && !options.buildSummaryOnly) { |
| 255 printAndFail('The option --build-summary-only-diet can be used only ' | 256 printAndFail('The option --build-summary-only-diet can be used only ' |
| 256 'together with --build-summary-only.'); | 257 'together with --build-summary-only.'); |
| 258 return null; // Only reachable in testing. |
| 257 } | 259 } |
| 258 | 260 |
| 259 return options; | 261 return options; |
| 260 } | 262 } |
| 261 | 263 |
| 262 /// The source files to analyze | 264 /// The source files to analyze |
| 263 List<String> get sourceFiles => _sourceFiles; | 265 List<String> get sourceFiles => _sourceFiles; |
| 264 | 266 |
| 265 /// Replace the sourceFiles parsed from the command line. | 267 /// Replace the sourceFiles parsed from the command line. |
| 266 void rewriteSourceFiles(List<String> newSourceFiles) { | 268 void rewriteSourceFiles(List<String> newSourceFiles) { |
| (...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 520 'Usage: $_binaryName [options...] <directory or list of files>'); | 522 'Usage: $_binaryName [options...] <directory or list of files>'); |
| 521 errorSink.writeln(''); | 523 errorSink.writeln(''); |
| 522 errorSink.writeln(parser.usage); | 524 errorSink.writeln(parser.usage); |
| 523 errorSink.writeln(''); | 525 errorSink.writeln(''); |
| 524 errorSink.writeln(''' | 526 errorSink.writeln(''' |
| 525 Run "dartanalyzer -h -v" for verbose help output, including less commonly used o
ptions. | 527 Run "dartanalyzer -h -v" for verbose help output, including less commonly used o
ptions. |
| 526 For more information, see http://www.dartlang.org/tools/analyzer. | 528 For more information, see http://www.dartlang.org/tools/analyzer. |
| 527 '''); | 529 '''); |
| 528 } | 530 } |
| 529 } | 531 } |
| OLD | NEW |