Improve handling of non-quoted strings in quoted string parser
This commit is contained in:
parent
75e59c9fe6
commit
490bdfa3a4
1 changed files with 6 additions and 0 deletions
|
|
@ -321,6 +321,12 @@ public final class StringArgument<C> extends CommandArgument<C, String> {
|
|||
final @NonNull CommandContext<C> commandContext,
|
||||
final @NonNull Queue<@NonNull String> inputQueue
|
||||
) {
|
||||
final String peek = inputQueue.peek();
|
||||
if (peek != null && !peek.startsWith("'") && !peek.startsWith("\"")) {
|
||||
inputQueue.remove();
|
||||
return ArgumentParseResult.success(peek);
|
||||
}
|
||||
|
||||
final StringJoiner sj = new StringJoiner(" ");
|
||||
for (final String string : inputQueue) {
|
||||
sj.add(string);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue