| 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 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 buildSuppressExitCode = args['build-suppress-exit-code'], | 156 buildSuppressExitCode = args['build-suppress-exit-code'], |
| 157 contextBuilderOptions = createContextBuilderOptions(args), | 157 contextBuilderOptions = createContextBuilderOptions(args), |
| 158 dartSdkPath = args['dart-sdk'], | 158 dartSdkPath = args['dart-sdk'], |
| 159 dartSdkSummaryPath = args['dart-sdk-summary'], | 159 dartSdkSummaryPath = args['dart-sdk-summary'], |
| 160 disableCacheFlushing = args['disable-cache-flushing'], | 160 disableCacheFlushing = args['disable-cache-flushing'], |
| 161 disableHints = args['no-hints'], | 161 disableHints = args['no-hints'], |
| 162 displayVersion = args['version'], | 162 displayVersion = args['version'], |
| 163 enableTypeChecks = args['enable_type_checks'], | 163 enableTypeChecks = args['enable_type_checks'], |
| 164 hintsAreFatal = args['fatal-hints'], | 164 hintsAreFatal = args['fatal-hints'], |
| 165 ignoreUnrecognizedFlags = args['ignore-unrecognized-flags'], | 165 ignoreUnrecognizedFlags = args['ignore-unrecognized-flags'], |
| 166 lints = args['lints'], | 166 lints = args[lintsFlag], |
| 167 log = args['log'], | 167 log = args['log'], |
| 168 machineFormat = args['format'] == 'machine', | 168 machineFormat = args['format'] == 'machine', |
| 169 perfReport = args['x-perf-report'], | 169 perfReport = args['x-perf-report'], |
| 170 shouldBatch = args['batch'], | 170 shouldBatch = args['batch'], |
| 171 showPackageWarnings = args['show-package-warnings'] || | 171 showPackageWarnings = args['show-package-warnings'] || |
| 172 args['package-warnings'] || | 172 args['package-warnings'] || |
| 173 args['x-package-warnings-prefix'] != null, | 173 args['x-package-warnings-prefix'] != null, |
| 174 showPackageWarningsPrefix = args['x-package-warnings-prefix'], | 174 showPackageWarningsPrefix = args['x-package-warnings-prefix'], |
| 175 showSdkWarnings = args['sdk-warnings'], | 175 showSdkWarnings = args['sdk-warnings'], |
| 176 sourceFiles = args.rest, | 176 sourceFiles = args.rest, |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 290 defineAnalysisArguments(parser, hide: hide); | 290 defineAnalysisArguments(parser, hide: hide); |
| 291 | 291 |
| 292 parser | 292 parser |
| 293 ..addOption('format', | 293 ..addOption('format', |
| 294 help: 'Specifies the format in which errors are displayed; the only ' | 294 help: 'Specifies the format in which errors are displayed; the only ' |
| 295 'currently allowed value is \'machine\'.') | 295 'currently allowed value is \'machine\'.') |
| 296 ..addFlag('version', | 296 ..addFlag('version', |
| 297 help: 'Print the analyzer version.', | 297 help: 'Print the analyzer version.', |
| 298 defaultsTo: false, | 298 defaultsTo: false, |
| 299 negatable: false) | 299 negatable: false) |
| 300 ..addFlag('lints', | |
| 301 help: 'Show lint results.', defaultsTo: false, negatable: false) | |
| 302 ..addFlag('no-hints', | 300 ..addFlag('no-hints', |
| 303 help: 'Do not show hint results.', | 301 help: 'Do not show hint results.', |
| 304 defaultsTo: false, | 302 defaultsTo: false, |
| 305 negatable: false) | 303 negatable: false) |
| 306 ..addFlag('fatal-hints', | 304 ..addFlag('fatal-hints', |
| 307 help: 'Treat hints as fatal.', defaultsTo: false, negatable: false) | 305 help: 'Treat hints as fatal.', defaultsTo: false, negatable: false) |
| 308 ..addFlag('fatal-warnings', | 306 ..addFlag('fatal-warnings', |
| 309 help: 'Treat non-type warnings as fatal.', | 307 help: 'Treat non-type warnings as fatal.', |
| 310 defaultsTo: false, | 308 defaultsTo: false, |
| 311 negatable: false) | 309 negatable: false) |
| (...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 514 'Usage: $_binaryName [options...] <directory or list of files>'); | 512 'Usage: $_binaryName [options...] <directory or list of files>'); |
| 515 errorSink.writeln(''); | 513 errorSink.writeln(''); |
| 516 errorSink.writeln(parser.usage); | 514 errorSink.writeln(parser.usage); |
| 517 errorSink.writeln(''); | 515 errorSink.writeln(''); |
| 518 errorSink.writeln(''' | 516 errorSink.writeln(''' |
| 519 Run "dartanalyzer -h -v" for verbose help output, including less commonly used o
ptions. | 517 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. | 518 For more information, see http://www.dartlang.org/tools/analyzer. |
| 521 '''); | 519 '''); |
| 522 } | 520 } |
| 523 } | 521 } |
| OLD | NEW |