| Index: lib/src/parser.dart
|
| diff --git a/lib/src/parser.dart b/lib/src/parser.dart
|
| index 9cd141c00a334b63b6ac491d5c38deb05aea510b..1e297b0e68b35069f57527e85ac3f6d8a63e781f 100644
|
| --- a/lib/src/parser.dart
|
| +++ b/lib/src/parser.dart
|
| @@ -92,8 +92,8 @@ class Parser {
|
| // Add in the leftover arguments we didn't parse to the innermost command.
|
| rest.addAll(args);
|
| args.clear();
|
| - return newArgResults(grammar, results, commandName, commandResults, rest,
|
| - arguments);
|
| + return newArgResults(
|
| + grammar, results, commandName, commandResults, rest, arguments);
|
| }
|
|
|
| /// Pulls the value for [option] from the second argument in [args].
|
| @@ -101,8 +101,7 @@ class Parser {
|
| /// Validates that there is a valid value there.
|
| void readNextArgAsValue(Option option) {
|
| // Take the option argument from the next command line arg.
|
| - validate(args.length > 0,
|
| - 'Missing argument for "${option.name}".');
|
| + validate(args.length > 0, 'Missing argument for "${option.name}".');
|
|
|
| // Make sure it isn't an option itself.
|
| validate(!_ABBR_OPT.hasMatch(current) && !_LONG_OPT.hasMatch(current),
|
| @@ -124,8 +123,8 @@ class Parser {
|
| var option = grammar.findByAbbreviation(soloOpt[1]);
|
| if (option == null) {
|
| // Walk up to the parent command if possible.
|
| - validate(parent != null,
|
| - 'Could not find an option or flag "-${soloOpt[1]}".');
|
| + validate(
|
| + parent != null, 'Could not find an option or flag "-${soloOpt[1]}".');
|
| return parent.parseSoloOption();
|
| }
|
|
|
| @@ -153,8 +152,8 @@ class Parser {
|
| var first = grammar.findByAbbreviation(c);
|
| if (first == null) {
|
| // Walk up to the parent command if possible.
|
| - validate(parent != null,
|
| - 'Could not find an option with short name "-$c".');
|
| + validate(
|
| + parent != null, 'Could not find an option with short name "-$c".');
|
| return parent.parseAbbreviation(innermostCommand);
|
| } else if (!first.isFlag) {
|
| // The first character is a non-flag option, so the rest must be the
|
| @@ -165,8 +164,8 @@ class Parser {
|
| // If we got some non-flag characters, then it must be a value, but
|
| // if we got here, it's a flag, which is wrong.
|
| validate(abbrOpt[2] == '',
|
| - 'Option "-$c" is a flag and cannot handle value '
|
| - '"${abbrOpt[1].substring(1)}${abbrOpt[2]}".');
|
| + 'Option "-$c" is a flag and cannot handle value '
|
| + '"${abbrOpt[1].substring(1)}${abbrOpt[2]}".');
|
|
|
| // Not an option, so all characters should be flags.
|
| // We use "innermostCommand" here so that if a parent command parses the
|
| @@ -186,16 +185,16 @@ class Parser {
|
| var option = grammar.findByAbbreviation(c);
|
| if (option == null) {
|
| // Walk up to the parent command if possible.
|
| - validate(parent != null,
|
| - 'Could not find an option with short name "-$c".');
|
| + validate(
|
| + parent != null, 'Could not find an option with short name "-$c".');
|
| parent.parseShortFlag(c);
|
| return;
|
| }
|
|
|
| // In a list of short options, only the first can be a non-flag. If
|
| // we get here we've checked that already.
|
| - validate(option.isFlag,
|
| - 'Option "-$c" must be a flag to be in a collapsed "-".');
|
| + validate(
|
| + option.isFlag, 'Option "-$c" must be a flag to be in a collapsed "-".');
|
|
|
| setOption(results, option, true);
|
| }
|
|
|