| 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 332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 343 'Specifies the path to the file where analysis results should be w
ritten.', | 343 'Specifies the path to the file where analysis results should be w
ritten.', |
| 344 hide: hide) | 344 hide: hide) |
| 345 ..addFlag('build-mode', | 345 ..addFlag('build-mode', |
| 346 // TODO(paulberry): add more documentation. | 346 // TODO(paulberry): add more documentation. |
| 347 help: 'Enable build mode.', | 347 help: 'Enable build mode.', |
| 348 defaultsTo: false, | 348 defaultsTo: false, |
| 349 negatable: false, | 349 negatable: false, |
| 350 hide: hide) | 350 hide: hide) |
| 351 ..addOption('build-summary-input', | 351 ..addOption('build-summary-input', |
| 352 help: 'Path to a summary file that contains information from a ' | 352 help: 'Path to a summary file that contains information from a ' |
| 353 'previous analysis run. May be specified multiple times.', | 353 'previous analysis run; may be specified multiple times.', |
| 354 allowMultiple: true, | 354 allowMultiple: true, |
| 355 hide: hide) | 355 hide: hide) |
| 356 ..addOption('build-summary-output', | 356 ..addOption('build-summary-output', |
| 357 help: 'Specifies the path to the file where the full summary ' | 357 help: 'Specifies the path to the file where the full summary ' |
| 358 'information should be written.', | 358 'information should be written.', |
| 359 hide: hide) | 359 hide: hide) |
| 360 ..addOption('build-summary-output-semantic', | 360 ..addOption('build-summary-output-semantic', |
| 361 help: 'Specifies the path to the file where the semantic summary ' | 361 help: 'Specifies the path to the file where the semantic summary ' |
| 362 'information should be written.', | 362 'information should be written.', |
| 363 hide: hide) | 363 hide: hide) |
| (...skipping 28 matching lines...) Expand all Loading... |
| 392 help: 'Ignore unrecognized command line flags.', | 392 help: 'Ignore unrecognized command line flags.', |
| 393 defaultsTo: false, | 393 defaultsTo: false, |
| 394 negatable: false, | 394 negatable: false, |
| 395 hide: hide) | 395 hide: hide) |
| 396 ..addFlag('disable-cache-flushing', defaultsTo: false, hide: hide) | 396 ..addFlag('disable-cache-flushing', defaultsTo: false, hide: hide) |
| 397 ..addOption('x-perf-report', | 397 ..addOption('x-perf-report', |
| 398 help: 'Writes a performance report to the given file (experimental).', | 398 help: 'Writes a performance report to the given file (experimental).', |
| 399 hide: hide) | 399 hide: hide) |
| 400 ..addOption('x-package-warnings-prefix', | 400 ..addOption('x-package-warnings-prefix', |
| 401 help: | 401 help: |
| 402 'Show warnings from package: imports that match the given prefix', | 402 'Show warnings from package: imports that match the given prefix.'
, |
| 403 hide: hide) | 403 hide: hide) |
| 404 ..addFlag('enable-conditional-directives', | 404 ..addFlag('enable-conditional-directives', |
| 405 help: | 405 help: |
| 406 'deprecated -- Enable support for conditional directives (DEP 40).
', | 406 'deprecated -- Enable support for conditional directives (DEP 40).
', |
| 407 defaultsTo: false, | 407 defaultsTo: false, |
| 408 negatable: false, | 408 negatable: false, |
| 409 hide: hide) | 409 hide: hide) |
| 410 ..addFlag('show-package-warnings', | 410 ..addFlag('show-package-warnings', |
| 411 help: 'Show warnings from package: imports (deprecated).', | 411 help: 'Show warnings from package: imports (deprecated).', |
| 412 defaultsTo: false, | 412 defaultsTo: false, |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 483 } | 483 } |
| 484 } else if (results['persistent_worker']) { | 484 } else if (results['persistent_worker']) { |
| 485 if (results.rest.isNotEmpty) { | 485 if (results.rest.isNotEmpty) { |
| 486 errorSink.writeln( | 486 errorSink.writeln( |
| 487 'No source files expected in the persistent worker mode.'); | 487 'No source files expected in the persistent worker mode.'); |
| 488 _showUsage(parser); | 488 _showUsage(parser); |
| 489 exitHandler(15); | 489 exitHandler(15); |
| 490 return null; // Only reachable in testing. | 490 return null; // Only reachable in testing. |
| 491 } | 491 } |
| 492 } else if (results['version']) { | 492 } else if (results['version']) { |
| 493 outSink.write('$_binaryName version ${_getVersion()}'); | 493 outSink.writeln('$_binaryName version ${_getVersion()}'); |
| 494 exitHandler(0); | 494 exitHandler(0); |
| 495 return null; // Only reachable in testing. | 495 return null; // Only reachable in testing. |
| 496 } else { | 496 } else { |
| 497 if (results.rest.isEmpty && !results['build-mode']) { | 497 if (results.rest.isEmpty && !results['build-mode']) { |
| 498 _showUsage(parser); | 498 _showUsage(parser); |
| 499 exitHandler(15); | 499 exitHandler(15); |
| 500 return null; // Only reachable in testing. | 500 return null; // Only reachable in testing. |
| 501 } | 501 } |
| 502 } | 502 } |
| 503 return new CommandLineOptions._fromArgs(results); | 503 return new CommandLineOptions._fromArgs(results); |
| (...skipping 10 matching lines...) Expand all Loading... |
| 514 'Usage: $_binaryName [options...] <directory or list of files>'); | 514 'Usage: $_binaryName [options...] <directory or list of files>'); |
| 515 errorSink.writeln(''); | 515 errorSink.writeln(''); |
| 516 errorSink.writeln(parser.usage); | 516 errorSink.writeln(parser.usage); |
| 517 errorSink.writeln(''); | 517 errorSink.writeln(''); |
| 518 errorSink.writeln(''' | 518 errorSink.writeln(''' |
| 519 Run "dartanalyzer -h -v" for verbose help output, including less commonly used o
ptions. | 519 Run "dartanalyzer -h -v" for verbose help output, including less commonly used o
ptions. |
| 520 For more information, see http://www.dartlang.org/tools/analyzer. | 520 For more information, see http://www.dartlang.org/tools/analyzer. |
| 521 '''); | 521 '''); |
| 522 } | 522 } |
| 523 } | 523 } |
| OLD | NEW |