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

Side by Side Diff: pkg/analyzer/lib/src/command_line/arguments.dart

Issue 2726783002: echo analysis options information if dartanalyzer --verbose is specified (Closed)
Patch Set: merge Created 3 years, 9 months 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 unified diff | Download patch
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/context/builder.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, 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.src.command_line.arguments; 5 library analyzer.src.command_line.arguments;
6 6
7 import 'dart:collection'; 7 import 'dart:collection';
8 8
9 import 'package:analyzer/file_system/file_system.dart'; 9 import 'package:analyzer/file_system/file_system.dart';
10 import 'package:analyzer/src/context/builder.dart'; 10 import 'package:analyzer/src/context/builder.dart';
(...skipping 14 matching lines...) Expand all
25 const String noImplicitDynamicFlag = 'no-implicit-dynamic'; 25 const String noImplicitDynamicFlag = 'no-implicit-dynamic';
26 const String packageRootOption = 'package-root'; 26 const String packageRootOption = 'package-root';
27 const String packagesOption = 'packages'; 27 const String packagesOption = 'packages';
28 const String sdkPathOption = 'dart-sdk'; 28 const String sdkPathOption = 'dart-sdk';
29 const String sdkSummaryPathOption = 'dart-sdk-summary'; 29 const String sdkSummaryPathOption = 'dart-sdk-summary';
30 const String strongModeFlag = 'strong'; 30 const String strongModeFlag = 'strong';
31 31
32 /** 32 /**
33 * Update [options] with the value of each analysis option command line flag. 33 * Update [options] with the value of each analysis option command line flag.
34 */ 34 */
35 void applyAnalysisOptionFlags(AnalysisOptionsImpl options, ArgResults args) { 35 void applyAnalysisOptionFlags(AnalysisOptionsImpl options, ArgResults args,
36 {void verbosePrint(String text)}) {
37 void verbose(String text) {
38 if (verbosePrint != null) {
39 verbosePrint('Analysis options: $text');
40 }
41 }
42
36 if (args.wasParsed(enableStrictCallChecksFlag)) { 43 if (args.wasParsed(enableStrictCallChecksFlag)) {
37 options.enableStrictCallChecks = args[enableStrictCallChecksFlag]; 44 options.enableStrictCallChecks = args[enableStrictCallChecksFlag];
45 verbose('$enableStrictCallChecksFlag = ${options.enableStrictCallChecks}');
38 } 46 }
39 if (args.wasParsed(enableSuperMixinFlag)) { 47 if (args.wasParsed(enableSuperMixinFlag)) {
40 options.enableSuperMixins = args[enableSuperMixinFlag]; 48 options.enableSuperMixins = args[enableSuperMixinFlag];
49 verbose('$enableSuperMixinFlag = ${options.enableSuperMixins}');
41 } 50 }
42 if (args.wasParsed(noImplicitCastsFlag)) { 51 if (args.wasParsed(noImplicitCastsFlag)) {
43 options.implicitCasts = !args[noImplicitCastsFlag]; 52 options.implicitCasts = !args[noImplicitCastsFlag];
53 verbose('$noImplicitCastsFlag = ${options.implicitCasts}');
44 } 54 }
45 if (args.wasParsed(noImplicitDynamicFlag)) { 55 if (args.wasParsed(noImplicitDynamicFlag)) {
46 options.implicitDynamic = !args[noImplicitDynamicFlag]; 56 options.implicitDynamic = !args[noImplicitDynamicFlag];
57 verbose('$noImplicitDynamicFlag = ${options.implicitDynamic}');
47 } 58 }
48 if (args.wasParsed(strongModeFlag)) { 59 if (args.wasParsed(strongModeFlag)) {
49 options.strongMode = args[strongModeFlag]; 60 options.strongMode = args[strongModeFlag];
61 verbose('$strongModeFlag = ${options.strongMode}');
50 } 62 }
51 try { 63 try {
52 if (args.wasParsed(lintsFlag)) { 64 if (args.wasParsed(lintsFlag)) {
53 options.lint = args[lintsFlag]; 65 options.lint = args[lintsFlag];
66 verbose('$lintsFlag = ${options.lint}');
54 } 67 }
55 } on ArgumentError { 68 } on ArgumentError {
56 // lints were not defined - ignore and fall through 69 // lints were not defined - ignore and fall through
57 } 70 }
58 } 71 }
59 72
60 /** 73 /**
61 * Use the given [resourceProvider], [contentCache] and command-line [args] to 74 * Use the given [resourceProvider], [contentCache] and command-line [args] to
62 * create a context builder. 75 * create a context builder.
63 */ 76 */
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after
314 .replaceAll('\r\n', '\n') 327 .replaceAll('\r\n', '\n')
315 .replaceAll('\r', '\n') 328 .replaceAll('\r', '\n')
316 .split('\n') 329 .split('\n')
317 .where((String line) => line.isNotEmpty)); 330 .where((String line) => line.isNotEmpty));
318 } on FileSystemException catch (e) { 331 } on FileSystemException catch (e) {
319 throw new Exception('Failed to read file specified by $lastArg : $e'); 332 throw new Exception('Failed to read file specified by $lastArg : $e');
320 } 333 }
321 } 334 }
322 return args; 335 return args;
323 } 336 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/context/builder.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698