OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 args.src.arg_parser; | 5 library args.src.arg_parser; |
6 | 6 |
7 import 'dart:collection'; | 7 import 'dart:collection'; |
8 | 8 |
9 import 'arg_results.dart'; | 9 import 'arg_results.dart'; |
10 import 'option.dart'; | 10 import 'option.dart'; |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 return options[option].defaultValue; | 154 return options[option].defaultValue; |
155 } | 155 } |
156 | 156 |
157 /// Finds the option whose abbreviation is [abbr], or `null` if no option has | 157 /// Finds the option whose abbreviation is [abbr], or `null` if no option has |
158 /// that abbreviation. | 158 /// that abbreviation. |
159 Option findByAbbreviation(String abbr) { | 159 Option findByAbbreviation(String abbr) { |
160 return options.values.firstWhere((option) => option.abbreviation == abbr, | 160 return options.values.firstWhere((option) => option.abbreviation == abbr, |
161 orElse: () => null); | 161 orElse: () => null); |
162 } | 162 } |
163 } | 163 } |
OLD | NEW |