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

Unified Diff: pkg/analyzer/lib/options.dart

Issue 940093003: Add ignore-unrecognized-flags as an option to the command line options of analysis server (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: pkg/analyzer/lib/options.dart
diff --git a/pkg/analyzer/lib/options.dart b/pkg/analyzer/lib/options.dart
index 50519dcfcc18409c41aba31340e972094c6d9528..9d9b5810f3ac12979232968b01434ff524c98389 100644
--- a/pkg/analyzer/lib/options.dart
+++ b/pkg/analyzer/lib/options.dart
@@ -133,7 +133,7 @@ class CommandLineOptions {
static CommandLineOptions _parse(List<String> args) {
args = args.expand((String arg) => arg.split('=')).toList();
- var parser = new _CommandLineParser()
+ var parser = new CommandLineParser()
..addFlag(
'batch',
abbr: 'b',
@@ -208,8 +208,7 @@ class CommandLineOptions {
..addOption(
'url-mapping',
help: '--url-mapping=libraryUri,/path/to/library.dart directs the '
- 'analyzer to use "library.dart" as the source for an import '
- 'of "libraryUri"',
+ 'analyzer to use "library.dart" as the source for an import ' 'of "libraryUri"',
allowMultiple: true)
//
// Hidden flags.
@@ -282,7 +281,9 @@ class CommandLineOptions {
customUrlMappings[splitMapping[0]] = splitMapping[1];
}
return new CommandLineOptions._fromArgs(
- results, definedVariables, customUrlMappings);
+ results,
+ definedVariables,
+ customUrlMappings);
} on FormatException catch (e) {
print(e.message);
_showUsage(parser);
@@ -305,17 +306,19 @@ class CommandLineOptions {
* TODO(pquitslund): when the args package supports ignoring unrecognized
* options/flags, this class can be replaced with a simple [ArgParser] instance.
*/
-class _CommandLineParser {
+class CommandLineParser {
final List<String> _knownFlags;
final ArgParser _parser;
/** Creates a new command line parser */
- _CommandLineParser()
+ CommandLineParser()
: _knownFlags = <String>[],
_parser = new ArgParser(allowTrailingOptions: true);
+ ArgParser get parser => _parser;
+
/**
* Defines a flag.
*

Powered by Google App Engine
This is Rietveld 408576698