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

Side by Side Diff: lib/src/analyzer/context.dart

Issue 2244703003: fixes #610, incorrect help output (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: fix usageexception printing Created 4 years, 4 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 | « bin/dartdevc.dart ('k') | lib/src/compiler/command.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) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
2 2
3 // for details. All rights reserved. Use of this source code is governed by a 3 // for details. All rights reserved. Use of this source code is governed by a
4 // BSD-style license that can be found in the LICENSE file. 4 // BSD-style license that can be found in the LICENSE file.
5 5
6 import 'package:args/args.dart' show ArgParser, ArgResults; 6 import 'package:args/args.dart' show ArgParser, ArgResults;
7 import 'package:analyzer/file_system/file_system.dart' 7 import 'package:analyzer/file_system/file_system.dart'
8 show ResourceProvider, ResourceUriResolver; 8 show ResourceProvider, ResourceUriResolver;
9 import 'package:analyzer/file_system/physical_file_system.dart' 9 import 'package:analyzer/file_system/physical_file_system.dart'
10 show PhysicalResourceProvider; 10 show PhysicalResourceProvider;
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 : summaryPaths = args['summary'] as List<String>, 67 : summaryPaths = args['summary'] as List<String>,
68 dartSdkPath = args['dart-sdk'] ?? getSdkDir().path, 68 dartSdkPath = args['dart-sdk'] ?? getSdkDir().path,
69 dartSdkSummaryPath = args['dart-sdk-summary'], 69 dartSdkSummaryPath = args['dart-sdk-summary'],
70 customUrlMappings = _parseUrlMappings(args['url-mapping']), 70 customUrlMappings = _parseUrlMappings(args['url-mapping']),
71 packageRoot = args['package-root'], 71 packageRoot = args['package-root'],
72 packagePaths = (args['package-paths'] as String)?.split(',') ?? []; 72 packagePaths = (args['package-paths'] as String)?.split(',') ?? [];
73 73
74 /// Whether to resolve 'package:' uris using the multi-package resolver. 74 /// Whether to resolve 'package:' uris using the multi-package resolver.
75 bool get useMultiPackage => packagePaths.isNotEmpty; 75 bool get useMultiPackage => packagePaths.isNotEmpty;
76 76
77 static ArgParser addArguments(ArgParser parser) { 77 static void addArguments(ArgParser parser) {
78 return parser 78 parser
79 ..addOption('summary', 79 ..addOption('summary',
80 abbr: 's', help: 'summary file(s) to include', allowMultiple: true) 80 abbr: 's', help: 'summary file(s) to include', allowMultiple: true)
81 ..addOption('dart-sdk', help: 'Dart SDK Path', defaultsTo: null) 81 ..addOption('dart-sdk', help: 'Dart SDK Path', defaultsTo: null)
82 ..addOption('dart-sdk-summary', 82 ..addOption('dart-sdk-summary',
83 help: 'Dart SDK Summary Path', defaultsTo: null) 83 help: 'Dart SDK Summary Path', defaultsTo: null)
84 ..addOption('package-root', 84 ..addOption('package-root',
85 abbr: 'p', 85 abbr: 'p',
86 help: 'Package root to resolve "package:" imports', 86 help: 'Package root to resolve "package:" imports',
87 defaultsTo: 'packages/') 87 defaultsTo: 'packages/')
88 ..addOption('url-mapping', 88 ..addOption('url-mapping',
89 help: '--url-mapping=libraryUri,/path/to/library.dart uses \n' 89 help: '--url-mapping=libraryUri,/path/to/library.dart uses\n'
90 'library.dart as the source for an import of of "libraryUri".', 90 'library.dart as the source for an import of of "libraryUri".',
91 allowMultiple: true, 91 allowMultiple: true,
92 splitCommas: false) 92 splitCommas: false)
93 ..addOption('package-paths', 93 ..addOption('package-paths',
94 help: 'use a list of directories to resolve "package:" imports'); 94 help: 'use a list of directories to resolve "package:" imports');
95 } 95 }
96 96
97 static Map<String, String> _parseUrlMappings(Iterable argument) { 97 static Map<String, String> _parseUrlMappings(Iterable argument) {
98 var mappings = <String, String>{}; 98 var mappings = <String, String>{};
99 for (var mapping in argument) { 99 for (var mapping in argument) {
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 return sdk; 191 return sdk;
192 } 192 }
193 193
194 /// Creates a [DartUriResolver] that uses the SDK at the given [sdkPath]. 194 /// Creates a [DartUriResolver] that uses the SDK at the given [sdkPath].
195 DartUriResolver createSdkPathResolver(String sdkSummaryPath, String sdkPath) { 195 DartUriResolver createSdkPathResolver(String sdkSummaryPath, String sdkPath) {
196 var sdk = (sdkSummaryPath != null) 196 var sdk = (sdkSummaryPath != null)
197 ? new SummaryBasedDartSdk(sdkSummaryPath, true) 197 ? new SummaryBasedDartSdk(sdkSummaryPath, true)
198 : _createDirectoryBasedDartSdk(sdkPath); 198 : _createDirectoryBasedDartSdk(sdkPath);
199 return new DartUriResolver(sdk); 199 return new DartUriResolver(sdk);
200 } 200 }
OLDNEW
« no previous file with comments | « bin/dartdevc.dart ('k') | lib/src/compiler/command.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698