Treat any trailing space as "a yet to be finished command" instead of a maybe valid argument

This commit is contained in:
Nathan Adams
2017-11-08 09:35:27 +01:00
parent 6e61fef225
commit 4d91bc6e7e
3 changed files with 14 additions and 6 deletions
@@ -152,10 +152,8 @@ public class CommandDispatcher<S> {
}
context.withCommand(child.getCommand());
if (reader.canRead()) {
if (reader.canRead(2)) {
reader.skip();
}
if (reader.canRead(2)) {
reader.skip();
if (child.getRedirect() != null) {
final CommandContextBuilder<S> childContext = new CommandContextBuilder<>(this, source, reader.getCursor());
childContext.withNode(child.getRedirect(), new StringRange(reader.getCursor(), reader.getCursor()));