Fix RichParser suggestions

This commit is contained in:
dordsor21 2021-09-18 15:07:41 +01:00
parent 54398ebe1c
commit fad1fcd8ee
No known key found for this signature in database
GPG Key ID: 1E53E88969FFCF0B

View File

@ -51,7 +51,7 @@ public abstract class RichParser<E> extends InputParser<E> implements AliasedPar
@Nonnull
private Function<String, Stream<? extends String>> extractArguments(String input) {
return prefix -> {
if (input.length() > prefix.length() && prefix.startsWith(input + "[")) {
if (input.length() > prefix.length() && input.startsWith(prefix + "[")) {
// input already contains argument(s) -> extract them
String[] strings = extractArguments(input.substring(prefix.length()), false);
// rebuild the argument string without the last argument