Chromium Code Reviews| Index: lib/args/args.dart |
| =================================================================== |
| --- lib/args/args.dart (revision 10607) |
| +++ lib/args/args.dart (working copy) |
| @@ -489,6 +489,14 @@ |
| return null; |
| } |
| + |
| + /** |
| + * Get the default value for an option. Useful after parsing to test |
| + * if the user specified something other than the default. |
|
Bob Nystrom
2012/08/16 21:26:58
This method is useful in its own right, but if it'
gram
2012/08/16 21:55:53
ArgResults does not have that information. We coul
|
| + */ |
| + |
| + getDefault(String option) => _options.containsKey(option) ? |
| + _options[option].defaultValue : null; |
|
Bob Nystrom
2012/08/16 21:26:58
If the option name is invalid, this should throw a
gram
2012/08/16 21:55:53
Done. I assume you mean IllegalArgument...
|
| } |
| /** |
| @@ -518,6 +526,9 @@ |
| return _options[name]; |
| } |
| + |
| + /** Get the names of the options as a [Collection]. */ |
| + Collection<String> get options => _options.getKeys(); |
|
Bob Nystrom
2012/08/16 21:26:58
Instead of this, how about making ArgResults imple
gram
2012/08/16 21:55:53
That seems like a lot of extra effort. All I want
|
| } |
| class _Option { |