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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 buildSummaryOnlyDiet = args['build-summary-only-diet'], | 153 buildSummaryOnlyDiet = args['build-summary-only-diet'], |
157 buildSummaryExcludeInformative = | 154 buildSummaryExcludeInformative = |
158 args['build-summary-exclude-informative'], | 155 args['build-summary-exclude-informative'], |
159 buildSummaryOutput = args['build-summary-output'], | 156 buildSummaryOutput = args['build-summary-output'], |
160 buildSuppressExitCode = args['build-suppress-exit-code'], | 157 buildSuppressExitCode = args['build-suppress-exit-code'], |
161 dartSdkPath = args['dart-sdk'], | 158 dartSdkPath = args['dart-sdk'], |
162 definedVariables = definedVariables, | 159 definedVariables = definedVariables, |
163 analysisOptionsFile = args['options'], | 160 analysisOptionsFile = args['options'], |
164 disableHints = args['no-hints'], | 161 disableHints = args['no-hints'], |
165 displayVersion = args['version'], | 162 displayVersion = args['version'], |
166 enableConditionalDirectives = args['enable-conditional-directives'], | |
167 enableNullAwareOperators = args['enable-null-aware-operators'], | 163 enableNullAwareOperators = args['enable-null-aware-operators'], |
168 enableStrictCallChecks = args['enable-strict-call-checks'], | 164 enableStrictCallChecks = args['enable-strict-call-checks'], |
169 enableSuperMixins = args['supermixin'], | 165 enableSuperMixins = args['supermixin'], |
170 enableTypeChecks = args['enable_type_checks'], | 166 enableTypeChecks = args['enable_type_checks'], |
171 hintsAreFatal = args['fatal-hints'], | 167 hintsAreFatal = args['fatal-hints'], |
172 ignoreUnrecognizedFlags = args['ignore-unrecognized-flags'], | 168 ignoreUnrecognizedFlags = args['ignore-unrecognized-flags'], |
173 lints = args['lints'], | 169 lints = args['lints'], |
174 log = args['log'], | 170 log = args['log'], |
175 machineFormat = args['machine'] || args['format'] == 'machine', | 171 machineFormat = args['machine'] || args['format'] == 'machine', |
176 packageConfigPath = args['packages'], | 172 packageConfigPath = args['packages'], |
(...skipping 470 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
647 | 643 |
648 int _getNextFlagIndex(args, i) { | 644 int _getNextFlagIndex(args, i) { |
649 for (; i < args.length; ++i) { | 645 for (; i < args.length; ++i) { |
650 if (args[i].startsWith('--')) { | 646 if (args[i].startsWith('--')) { |
651 return i; | 647 return i; |
652 } | 648 } |
653 } | 649 } |
654 return i; | 650 return i; |
655 } | 651 } |
656 } | 652 } |
OLD | NEW |