From 9c85db386ff1caf7f87881fdca03aa2674a37ef8 Mon Sep 17 00:00:00 2001 From: Frank van der Heijden Date: Fri, 30 Jul 2021 19:26:01 +0200 Subject: [PATCH] Fix raw input in command execution --- .../src/main/java/cloud/commandframework/CommandManager.java | 2 ++ .../java/cloud/commandframework/context/CommandContext.java | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/cloud-core/src/main/java/cloud/commandframework/CommandManager.java b/cloud-core/src/main/java/cloud/commandframework/CommandManager.java index ae9a4fd0..1f00a275 100644 --- a/cloud-core/src/main/java/cloud/commandframework/CommandManager.java +++ b/cloud-core/src/main/java/cloud/commandframework/CommandManager.java @@ -171,6 +171,8 @@ public abstract class CommandManager { this ); final LinkedList inputQueue = new CommandInputTokenizer(input).tokenize(); + /* Store a copy of the input queue in the context */ + context.store("__raw_input__", new LinkedList<>(inputQueue)); try { if (this.preprocessContext(context, inputQueue) == State.ACCEPTED) { return this.commandExecutionCoordinator.coordinateExecution(context, inputQueue); diff --git a/cloud-core/src/main/java/cloud/commandframework/context/CommandContext.java b/cloud-core/src/main/java/cloud/commandframework/context/CommandContext.java index 243fb64a..2ffb8ac9 100644 --- a/cloud-core/src/main/java/cloud/commandframework/context/CommandContext.java +++ b/cloud-core/src/main/java/cloud/commandframework/context/CommandContext.java @@ -537,7 +537,7 @@ public final class CommandContext { } /** - * Get the raw input. This should only be used when {@link #isSuggestions()} is {@code true} + * Get the raw input. * * @return Raw input in token form */