OLD | NEW |
1 library options; | 1 library options; |
2 | 2 |
3 import 'package:collection_helpers/wrappers.dart'; | 3 import 'package:collection/wrappers.dart'; |
4 | 4 |
5 /** | 5 /** |
6 * A command-line option. Includes both flags and options which take a value. | 6 * A command-line option. Includes both flags and options which take a value. |
7 */ | 7 */ |
8 class Option { | 8 class Option { |
9 final String name; | 9 final String name; |
10 final String abbreviation; | 10 final String abbreviation; |
11 final List<String> allowed; | 11 final List<String> allowed; |
12 final defaultValue; | 12 final defaultValue; |
13 final Function callback; | 13 final Function callback; |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 } | 46 } |
47 | 47 |
48 if (_invalidChars.hasMatch(abbreviation)) { | 48 if (_invalidChars.hasMatch(abbreviation)) { |
49 throw new ArgumentError('Abbreviation is an invalid character.'); | 49 throw new ArgumentError('Abbreviation is an invalid character.'); |
50 } | 50 } |
51 } | 51 } |
52 } | 52 } |
53 | 53 |
54 static final _invalidChars = new RegExp(r'''[ \t\r\n"'\\/]'''); | 54 static final _invalidChars = new RegExp(r'''[ \t\r\n"'\\/]'''); |
55 } | 55 } |
OLD | NEW |