| 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_cli/src/driver.dart'; | 9 import 'package:analyzer_cli/src/driver.dart'; |
| 10 import 'package:args/args.dart'; | 10 import 'package:args/args.dart'; |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 | 73 |
| 74 /// A table mapping the names of defined variables to their values. | 74 /// A table mapping the names of defined variables to their values. |
| 75 final Map<String, String> definedVariables; | 75 final Map<String, String> definedVariables; |
| 76 | 76 |
| 77 /// Whether to report hints | 77 /// Whether to report hints |
| 78 final bool disableHints; | 78 final bool disableHints; |
| 79 | 79 |
| 80 /// Whether to display version information | 80 /// Whether to display version information |
| 81 final bool displayVersion; | 81 final bool displayVersion; |
| 82 | 82 |
| 83 /// Whether to enable conditional directives (DEP 40). | |
| 84 final bool enableConditionalDirectives; | |
| 85 | |
| 86 /// Whether to enable null-aware operators (DEP 9). | 83 /// Whether to enable null-aware operators (DEP 9). |
| 87 final bool enableNullAwareOperators; | 84 final bool enableNullAwareOperators; |
| 88 | 85 |
| 89 /// Whether to strictly follow the specification when generating warnings on | 86 /// Whether to strictly follow the specification when generating warnings on |
| 90 /// "call" methods (fixes dartbug.com/21938). | 87 /// "call" methods (fixes dartbug.com/21938). |
| 91 final bool enableStrictCallChecks; | 88 final bool enableStrictCallChecks; |
| 92 | 89 |
| 93 /// Whether to relax restrictions on mixins (DEP 34). | 90 /// Whether to relax restrictions on mixins (DEP 34). |
| 94 final bool enableSuperMixins; | 91 final bool enableSuperMixins; |
| 95 | 92 |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 159 buildSummaryOnlyDiet = args['build-summary-only-diet'], | 156 buildSummaryOnlyDiet = args['build-summary-only-diet'], |
| 160 buildSummaryExcludeInformative = | 157 buildSummaryExcludeInformative = |
| 161 args['build-summary-exclude-informative'], | 158 args['build-summary-exclude-informative'], |
| 162 buildSummaryOutput = args['build-summary-output'], | 159 buildSummaryOutput = args['build-summary-output'], |
| 163 buildSuppressExitCode = args['build-suppress-exit-code'], | 160 buildSuppressExitCode = args['build-suppress-exit-code'], |
| 164 dartSdkPath = args['dart-sdk'], | 161 dartSdkPath = args['dart-sdk'], |
| 165 definedVariables = definedVariables, | 162 definedVariables = definedVariables, |
| 166 analysisOptionsFile = args['options'], | 163 analysisOptionsFile = args['options'], |
| 167 disableHints = args['no-hints'], | 164 disableHints = args['no-hints'], |
| 168 displayVersion = args['version'], | 165 displayVersion = args['version'], |
| 169 enableConditionalDirectives = args['enable-conditional-directives'], | |
| 170 enableNullAwareOperators = args['enable-null-aware-operators'], | 166 enableNullAwareOperators = args['enable-null-aware-operators'], |
| 171 enableStrictCallChecks = args['enable-strict-call-checks'], | 167 enableStrictCallChecks = args['enable-strict-call-checks'], |
| 172 enableSuperMixins = args['supermixin'], | 168 enableSuperMixins = args['supermixin'], |
| 173 enableTypeChecks = args['enable_type_checks'], | 169 enableTypeChecks = args['enable_type_checks'], |
| 174 hintsAreFatal = args['fatal-hints'], | 170 hintsAreFatal = args['fatal-hints'], |
| 175 ignoreUnrecognizedFlags = args['ignore-unrecognized-flags'], | 171 ignoreUnrecognizedFlags = args['ignore-unrecognized-flags'], |
| 176 lints = args['lints'], | 172 lints = args['lints'], |
| 177 log = args['log'], | 173 log = args['log'], |
| 178 machineFormat = args['machine'] || args['format'] == 'machine', | 174 machineFormat = args['machine'] || args['format'] == 'machine', |
| 179 packageConfigPath = args['packages'], | 175 packageConfigPath = args['packages'], |
| (...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 412 help: 'Enable support for the proposed async feature.', | 408 help: 'Enable support for the proposed async feature.', |
| 413 defaultsTo: false, | 409 defaultsTo: false, |
| 414 negatable: false, | 410 negatable: false, |
| 415 hide: true) | 411 hide: true) |
| 416 ..addFlag('enable-enum', | 412 ..addFlag('enable-enum', |
| 417 help: 'Enable support for the proposed enum feature.', | 413 help: 'Enable support for the proposed enum feature.', |
| 418 defaultsTo: false, | 414 defaultsTo: false, |
| 419 negatable: false, | 415 negatable: false, |
| 420 hide: true) | 416 hide: true) |
| 421 ..addFlag('enable-conditional-directives', | 417 ..addFlag('enable-conditional-directives', |
| 422 help: 'Enable support for conditional directives (DEP 40).', | 418 help: |
| 419 'deprecated -- Enable support for conditional directives (DEP 40).
', |
| 423 defaultsTo: false, | 420 defaultsTo: false, |
| 424 negatable: false, | 421 negatable: false, |
| 425 hide: true) | 422 hide: true) |
| 426 ..addFlag('enable-null-aware-operators', | 423 ..addFlag('enable-null-aware-operators', |
| 427 help: 'Enable support for null-aware operators (DEP 9).', | 424 help: 'Enable support for null-aware operators (DEP 9).', |
| 428 defaultsTo: false, | 425 defaultsTo: false, |
| 429 negatable: false, | 426 negatable: false, |
| 430 hide: true) | 427 hide: true) |
| 431 ..addFlag('enable-strict-call-checks', | 428 ..addFlag('enable-strict-call-checks', |
| 432 help: 'Fix issue 21938.', | 429 help: 'Fix issue 21938.', |
| 433 defaultsTo: false, | 430 defaultsTo: false, |
| 434 negatable: false, | 431 negatable: false, |
| 435 hide: true) | 432 hide: true) |
| 436 ..addFlag('enable-new-task-model', | 433 ..addFlag('enable-new-task-model', |
| 437 help: 'Ennable new task model.', | 434 help: 'deprecated -- Ennable new task model.', |
| 438 defaultsTo: false, | 435 defaultsTo: false, |
| 439 negatable: false, | 436 negatable: false, |
| 440 hide: true) | 437 hide: true) |
| 441 ..addFlag('supermixin', | 438 ..addFlag('supermixin', |
| 442 help: 'Relax restrictions on mixins (DEP 34).', | 439 help: 'Relax restrictions on mixins (DEP 34).', |
| 443 defaultsTo: false, | 440 defaultsTo: false, |
| 444 negatable: false, | 441 negatable: false, |
| 445 hide: true) | 442 hide: true) |
| 446 ..addFlag('log', | 443 ..addFlag('log', |
| 447 help: 'Log additional messages and exceptions.', | 444 help: 'Log additional messages and exceptions.', |
| (...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 670 | 667 |
| 671 int _getNextFlagIndex(args, i) { | 668 int _getNextFlagIndex(args, i) { |
| 672 for (; i < args.length; ++i) { | 669 for (; i < args.length; ++i) { |
| 673 if (args[i].startsWith('--')) { | 670 if (args[i].startsWith('--')) { |
| 674 return i; | 671 return i; |
| 675 } | 672 } |
| 676 } | 673 } |
| 677 return i; | 674 return i; |
| 678 } | 675 } |
| 679 } | 676 } |
| OLD | NEW |