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

Side by Side Diff: pkg/analyzer/lib/options.dart

Issue 720143002: Allow dartanalyzer to parse options after the filename argument. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 1 month 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | 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) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 options; 5 library options;
6 6
7 import 'dart:io'; 7 import 'dart:io';
8 8
9 import 'package:args/args.dart'; 9 import 'package:args/args.dart';
10 10
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 * options/flags, this class can be replaced with a simple [ArgParser] instance. 236 * options/flags, this class can be replaced with a simple [ArgParser] instance.
237 */ 237 */
238 class _CommandLineParser { 238 class _CommandLineParser {
239 239
240 final List<String> _knownFlags; 240 final List<String> _knownFlags;
241 final ArgParser _parser; 241 final ArgParser _parser;
242 242
243 /** Creates a new command line parser */ 243 /** Creates a new command line parser */
244 _CommandLineParser() 244 _CommandLineParser()
245 : _knownFlags = <String>[], 245 : _knownFlags = <String>[],
246 _parser = new ArgParser(); 246 _parser = new ArgParser(allowTrailingOptions: true);
247 247
248 248
249 /** 249 /**
250 * Defines a flag. 250 * Defines a flag.
251 * 251 *
252 * See [ArgParser.addFlag()]. 252 * See [ArgParser.addFlag()].
253 */ 253 */
254 void addFlag(String name, {String abbr, String help, bool defaultsTo: false, 254 void addFlag(String name, {String abbr, String help, bool defaultsTo: false,
255 bool negatable: true, void callback(bool value), bool hide: false}) { 255 bool negatable: true, void callback(bool value), bool hide: false}) {
256 _knownFlags.add(name); 256 _knownFlags.add(name);
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
340 340
341 _getNextFlagIndex(args, i) { 341 _getNextFlagIndex(args, i) {
342 for ( ; i < args.length; ++i) { 342 for ( ; i < args.length; ++i) {
343 if (args[i].startsWith('--')) { 343 if (args[i].startsWith('--')) {
344 return i; 344 return i;
345 } 345 }
346 } 346 }
347 return i; 347 return i;
348 } 348 }
349 } 349 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698