| 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 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 273 return "<unknown>"; | 273 return "<unknown>"; |
| 274 } | 274 } |
| 275 } | 275 } |
| 276 | 276 |
| 277 static CommandLineOptions _parse(List<String> args) { | 277 static CommandLineOptions _parse(List<String> args) { |
| 278 args = preprocessArgs(PhysicalResourceProvider.INSTANCE, args); | 278 args = preprocessArgs(PhysicalResourceProvider.INSTANCE, args); |
| 279 | 279 |
| 280 bool verbose = args.contains('-v') || args.contains('--verbose'); | 280 bool verbose = args.contains('-v') || args.contains('--verbose'); |
| 281 bool hide = !verbose; | 281 bool hide = !verbose; |
| 282 | 282 |
| 283 args = args.expand((String arg) => arg.split('=')).toList(); | |
| 284 var parser = new ArgParser(allowTrailingOptions: true) | 283 var parser = new ArgParser(allowTrailingOptions: true) |
| 285 ..addFlag('batch', | 284 ..addFlag('batch', |
| 286 abbr: 'b', | 285 abbr: 'b', |
| 287 help: 'Read commands from standard input (for testing).', | 286 help: 'Read commands from standard input (for testing).', |
| 288 defaultsTo: false, | 287 defaultsTo: false, |
| 289 negatable: false) | 288 negatable: false) |
| 290 ..addOption('dart-sdk', help: 'The path to the Dart SDK.') | 289 ..addOption('dart-sdk', help: 'The path to the Dart SDK.') |
| 291 ..addOption('dart-sdk-summary', | 290 ..addOption('dart-sdk-summary', |
| 292 help: 'The path to the Dart SDK summary file.', hide: true) | 291 help: 'The path to the Dart SDK summary file.', hide: true) |
| 293 ..addOption('packages', | 292 ..addOption('packages', |
| (...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 562 | 561 |
| 563 static _showUsage(parser) { | 562 static _showUsage(parser) { |
| 564 errorSink | 563 errorSink |
| 565 .writeln('Usage: $_binaryName [options...] <libraries to analyze...>'); | 564 .writeln('Usage: $_binaryName [options...] <libraries to analyze...>'); |
| 566 errorSink.writeln(parser.getUsage()); | 565 errorSink.writeln(parser.getUsage()); |
| 567 errorSink.writeln(''); | 566 errorSink.writeln(''); |
| 568 errorSink.writeln( | 567 errorSink.writeln( |
| 569 'For more information, see http://www.dartlang.org/tools/analyzer.'); | 568 'For more information, see http://www.dartlang.org/tools/analyzer.'); |
| 570 } | 569 } |
| 571 } | 570 } |
| OLD | NEW |