Chromium Code Reviews| Index: pkg/analyzer/lib/src/command_line/arguments.dart |
| diff --git a/pkg/analyzer/lib/src/command_line/arguments.dart b/pkg/analyzer/lib/src/command_line/arguments.dart |
| index 5b43d3c2e489671794c6971205affe0e5f0ca587..f85a34eb0a3baa8b4f5fb7dc226ed4f15a8c4d1c 100644 |
| --- a/pkg/analyzer/lib/src/command_line/arguments.dart |
| +++ b/pkg/analyzer/lib/src/command_line/arguments.dart |
| @@ -104,25 +104,15 @@ DartSdkManager createDartSdkManager( |
| * are those that are typically used to control the way in which the code is |
| * analyzed. |
| */ |
| -void defineAnalysisArguments(ArgParser parser) { |
| - parser.addOption(defineVariableOption, |
| - abbr: 'D', |
| - allowMultiple: true, |
| - help: 'Define environment variables. For example, "-Dfoo=bar" defines an ' |
| - 'environment variable named "foo" whose value is "bar".'); |
| - parser.addOption(sdkPathOption, help: 'The path to the Dart SDK.'); |
| - parser.addOption(sdkSummaryPathOption, |
| - help: 'The path to the Dart SDK summary file.', hide: true); |
| +void defineAnalysisArguments(ArgParser parser, {bool hide: true}) { |
| + defineDDCAnalysisArguments(parser, hide: hide); |
| + |
| parser.addOption(analysisOptionsFileOption, |
| help: 'Path to an analysis options file.'); |
| parser.addOption(packagesOption, |
| help: 'The path to the package resolution configuration file, which ' |
| 'supplies a mapping of package names to paths. This option cannot be ' |
| 'used with --package-root.'); |
| - parser.addOption(packageRootOption, |
| - abbr: 'p', |
| - help: 'The path to a package root directory (deprecated). This option ' |
| - 'cannot be used with --packages.'); |
| parser.addFlag(strongModeFlag, |
| help: 'Enable strong static checks (https://goo.gl/DqcBsw)'); |
| @@ -139,29 +129,51 @@ void defineAnalysisArguments(ArgParser parser) { |
| // help: 'Enable support for null-aware operators (DEP 9).', |
| // defaultsTo: false, |
| // negatable: false, |
| -// hide: true); |
| +// hide: hide); |
| parser.addFlag(enableStrictCallChecksFlag, |
| help: 'Fix issue 21938.', |
| defaultsTo: false, |
| negatable: false, |
| - hide: true); |
| + hide: hide); |
| parser.addFlag(enableInitializingFormalAccessFlag, |
| help: |
| 'Enable support for allowing access to field formal parameters in a ' |
| 'constructor\'s initializer list', |
| defaultsTo: false, |
| negatable: false, |
| - hide: true); |
| + hide: hide); |
| parser.addFlag(enableSuperInMixinFlag, |
| help: 'Relax restrictions on mixins (DEP 34).', |
| defaultsTo: false, |
| negatable: false, |
| - hide: true); |
| + hide: hide); |
| // parser.addFlag('enable_type_checks', |
| // help: 'Check types in constant evaluation.', |
| // defaultsTo: false, |
| // negatable: false, |
| -// hide: true); |
| +// hide: hide); |
| +} |
| + |
| +/** |
| + * Add the DDC analysis flags and options to the given [parser]. |
| + * |
| + * TODO(danrubel) Update DDC to support all the options defined in |
| + * the [defineAnalysisOptions] method above, then have DDC call that method |
| + * and remove this method. |
|
Brian Wilkerson
2016/12/15 18:58:40
That should be easy after we get ddc to use the Co
danrubel
2016/12/15 19:02:42
Yup. That makes sense as my next step.
|
| + */ |
| +void defineDDCAnalysisArguments(ArgParser parser, {bool hide: true}) { |
| + parser.addOption(defineVariableOption, |
| + abbr: 'D', |
| + allowMultiple: true, |
| + help: 'Define environment variables. For example, "-Dfoo=bar" defines an ' |
| + 'environment variable named "foo" whose value is "bar".'); |
| + parser.addOption(sdkPathOption, help: 'The path to the Dart SDK.'); |
| + parser.addOption(sdkSummaryPathOption, |
| + help: 'The path to the Dart SDK summary file.', hide: hide); |
| + parser.addOption(packageRootOption, |
| + abbr: 'p', |
| + help: 'The path to a package root directory (deprecated). ' |
| + 'This option cannot be used with --packages.'); |
| } |
| /** |