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

Side by Side Diff: pkg/args/args.dart

Issue 10837315: Fix syntax error in args.dart, reenable args tests. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | pkg/pkg.status » ('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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 /** 5 /**
6 * This library lets you define parsers for parsing raw command-line arguments 6 * This library lets you define parsers for parsing raw command-line arguments
7 * into a set of options and values using [GNU][] and [POSIX][] style options. 7 * into a set of options and values using [GNU][] and [POSIX][] style options.
8 * 8 *
9 * ## Defining options ## 9 * ## Defining options ##
10 * 10 *
(...skipping 513 matching lines...) Expand 10 before | Expand all | Expand 10 after
524 operator [](String name) { 524 operator [](String name) {
525 if (!_options.containsKey(name)) { 525 if (!_options.containsKey(name)) {
526 throw new IllegalArgumentException( 526 throw new IllegalArgumentException(
527 'Could not find an option named "$name".'); 527 'Could not find an option named "$name".');
528 } 528 }
529 529
530 return _options[name]; 530 return _options[name];
531 } 531 }
532 532
533 /** Get the names of the options as a [Collection]. */ 533 /** Get the names of the options as a [Collection]. */
534 Collection<String> get options => _options.getKeys(); 534 Collection<String> get options() => _options.getKeys();
535 } 535 }
536 536
537 class _Option { 537 class _Option {
538 final String name; 538 final String name;
539 final String abbreviation; 539 final String abbreviation;
540 final List allowed; 540 final List allowed;
541 final defaultValue; 541 final defaultValue;
542 final Function callback; 542 final Function callback;
543 final String help; 543 final String help;
544 final Map<String, String> allowedHelp; 544 final Map<String, String> allowedHelp;
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after
763 allowedBuffer.add(allowed); 763 allowedBuffer.add(allowed);
764 if (allowed == option.defaultValue) { 764 if (allowed == option.defaultValue) {
765 allowedBuffer.add(' (default)'); 765 allowedBuffer.add(' (default)');
766 } 766 }
767 first = false; 767 first = false;
768 } 768 }
769 allowedBuffer.add(']'); 769 allowedBuffer.add(']');
770 return allowedBuffer.toString(); 770 return allowedBuffer.toString();
771 } 771 }
772 } 772 }
OLDNEW
« no previous file with comments | « no previous file | pkg/pkg.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698