Changes the parser to allow argument shorthands of any length
This commit is contained in:
@ -56,8 +56,8 @@ public final class Parser {
|
||||
String argumentName = currentToken.substring(2);
|
||||
foundArguments = ListUtil.getMatching(converterArguments, (item) -> item.getName().equals(argumentName));
|
||||
} else if (currentToken.startsWith("-")) {
|
||||
char argumentShorthand = currentToken.substring(1).charAt(0);
|
||||
foundArguments = ListUtil.getMatching(converterArguments, (item) -> item.getShorthand() == argumentShorthand);
|
||||
String argumentShorthand = currentToken.substring(1);
|
||||
foundArguments = ListUtil.getMatching(converterArguments, (item) -> item.getShorthand().equals(argumentShorthand));
|
||||
} else {
|
||||
throw new IllegalArgumentException("Unexpected value when not given an argument.");
|
||||
}
|
||||
|
Reference in New Issue
Block a user