Fix wrong parser message

- Parser error message gave wrong lower level arity value
  if option didn't have enough arguments
- Fixes #930
This commit is contained in:
Janne Valkealahti
2023-11-27 14:28:41 +00:00
parent 8d6223de46
commit b1084a62ee
6 changed files with 107 additions and 1 deletions

View File

@@ -351,7 +351,7 @@ public interface Parser {
if (currentOption.getArityMin() > -1 && toUse.size() < currentOption.getArityMin()) {
String arg = currentOption.getLongNames()[0];
commonMessageResults.add(MessageResult.of(ParserMessage.NOT_ENOUGH_OPTION_ARGUMENTS, 0, arg,
toUse.size()));
currentOption.getArityMin()));
}
else if (currentOption.getArityMax() > -1 && toUse.size() > currentOption.getArityMax()) {
String arg = currentOption.getLongNames()[0];