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

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

Issue 2584293003: DDC/AnalyzerCLI common cmdline option processing (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 f85a34eb0a3baa8b4f5fb7dc226ed4f15a8c4d1c..7c3a9e83ea45e325fabfe57c66bb04888ff24e87 100644
--- a/pkg/analyzer/lib/src/command_line/arguments.dart
+++ b/pkg/analyzer/lib/src/command_line/arguments.dart
@@ -104,24 +104,40 @@ DartSdkManager createDartSdkManager(
* are those that are typically used to control the way in which the code is
* analyzed.
*/
-void defineAnalysisArguments(ArgParser parser, {bool hide: true}) {
- defineDDCAnalysisArguments(parser, hide: hide);
+void defineAnalysisArguments(ArgParser parser, {bool hide: true, ddc: false}) {
Brian Wilkerson 2016/12/19 17:45:36 'ddc' --> 'bool ddc' I'm not fond of the client-s
danrubel 2016/12/19 21:21:17 Yes, this is temporary until I can normalize DDC o
+ 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(analysisOptionsFileOption,
- help: 'Path to an analysis options file.');
+ help: 'Path to an analysis options file.', hide: ddc);
+
+ parser.addOption(packageRootOption,
+ abbr: 'p',
+ help: 'The path to a package root directory (deprecated). '
+ 'This option cannot be used with --packages.');
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.');
+ 'used with --package-root.',
+ hide: ddc);
parser.addFlag(strongModeFlag,
- help: 'Enable strong static checks (https://goo.gl/DqcBsw)');
+ help: 'Enable strong static checks (https://goo.gl/DqcBsw)', hide: ddc);
Brian Wilkerson 2016/12/19 17:45:36 I think this needs to include 'defaultsTo: ddc,'.
danrubel 2016/12/19 21:21:17 Good point. Done.
parser.addFlag(noImplicitCastsFlag,
negatable: false,
- help: 'Disable implicit casts in strong mode (https://goo.gl/cTLz40)');
+ help: 'Disable implicit casts in strong mode (https://goo.gl/cTLz40)',
+ hide: ddc);
parser.addFlag(noImplicitDynamicFlag,
negatable: false,
- help: 'Disable implicit dynamic (https://goo.gl/m0UgXD)');
+ help: 'Disable implicit dynamic (https://goo.gl/m0UgXD)',
+ hide: ddc);
//
// Hidden flags and options.
//
@@ -129,51 +145,29 @@ void defineAnalysisArguments(ArgParser parser, {bool hide: true}) {
// help: 'Enable support for null-aware operators (DEP 9).',
// defaultsTo: false,
// negatable: false,
-// hide: hide);
+// hide: hide || ddc);
parser.addFlag(enableStrictCallChecksFlag,
help: 'Fix issue 21938.',
defaultsTo: false,
negatable: false,
- hide: hide);
+ hide: hide || ddc);
parser.addFlag(enableInitializingFormalAccessFlag,
help:
'Enable support for allowing access to field formal parameters in a '
'constructor\'s initializer list',
defaultsTo: false,
negatable: false,
- hide: hide);
+ hide: hide || ddc);
parser.addFlag(enableSuperInMixinFlag,
help: 'Relax restrictions on mixins (DEP 34).',
defaultsTo: false,
negatable: false,
- hide: hide);
+ hide: hide || ddc);
// parser.addFlag('enable_type_checks',
// help: 'Check types in constant evaluation.',
// defaultsTo: false,
// negatable: false,
-// 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.
- */
-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.');
+// hide: hide || ddc);
}
/**
« 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