diff options
Diffstat (limited to '')
| -rw-r--r-- | src/CommandParser.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/CommandParser.cpp b/src/CommandParser.cpp index 7a8eb00..8f83575 100644 --- a/src/CommandParser.cpp +++ b/src/CommandParser.cpp @@ -6,6 +6,7 @@ CommandParser::CommandParser() {} Cmd CommandParser::parse(QString input) { + // TODO: simplify this to only parse the command auto parts = input.split(QRegularExpression("\\s+"), Qt::SkipEmptyParts); if (parts.isEmpty()) @@ -13,9 +14,7 @@ Cmd CommandParser::parse(QString input) { auto cmdStr = parts.first(); auto cmd = toCommandType(cmdStr); - auto rawArgs = input.slice(cmdStr.length()); - - parts.removeFirst(); + auto rawArgs = input.slice(cmdStr.length()).trimmed(); return {.command = cmd, .argsString = rawArgs, .rawInput = input}; } |
