Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(180)

Unified Diff: pkg/analyzer/lib/src/command_line/arguments.dart

Issue 2580933002: refactor DDC and Analyzer CLI parser option declaration (Closed)
Patch Set: Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | pkg/analyzer_cli/lib/src/options.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.');
}
/**
« no previous file with comments | « no previous file | pkg/analyzer_cli/lib/src/options.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698