Skip to content

Commit

Permalink
Fix flags not throwing MissingArgumentException (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
Revxrsal committed Mar 8, 2022
1 parent 0b1ccd8 commit 9b5f5da
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,8 @@ private void handleSwitch(ArgumentStack args, Object[] values, CommandParameter
}
} else {
args.remove(index); // remove the flag prefix + flag name
if (args.isEmpty())
throw new MissingArgumentException(parameter);
flagArguments = ArgumentStack.of(args.remove(index)); // put the actual value in a separate argument stack
}
ValueContextR contextR = new ValueContextR(input, actor, parameter, values, flagArguments);
Expand Down

0 comments on commit 9b5f5da

Please sign in to comment.