Prefix commands with $ to format the command itself
This commit is contained in:
parent
b1a14260f9
commit
8fe261cb82
|
@ -11,6 +11,7 @@
|
||||||
#include "expressionparser.h"
|
#include "expressionparser.h"
|
||||||
#include "variable.h"
|
#include "variable.h"
|
||||||
#include "cmd-undocumented.h"
|
#include "cmd-undocumented.h"
|
||||||
|
#include "stringformat.h"
|
||||||
|
|
||||||
COMMAND* cmd_list = 0;
|
COMMAND* cmd_list = 0;
|
||||||
|
|
||||||
|
@ -207,6 +208,17 @@ bool cbCommandProvider(char* cmd, int maxlen);
|
||||||
|
|
||||||
void cmdsplit(const char* cmd, StringList & commands)
|
void cmdsplit(const char* cmd, StringList & commands)
|
||||||
{
|
{
|
||||||
|
// Allow prefixing commands with $ to format them
|
||||||
|
String cmdFormatted;
|
||||||
|
if(*cmd == '$')
|
||||||
|
{
|
||||||
|
cmd++;
|
||||||
|
while(*cmd == ' ')
|
||||||
|
cmd++;
|
||||||
|
cmdFormatted = stringformatinline(cmd);
|
||||||
|
cmd = cmdFormatted.c_str();
|
||||||
|
}
|
||||||
|
|
||||||
commands.clear();
|
commands.clear();
|
||||||
auto len = strlen(cmd);
|
auto len = strlen(cmd);
|
||||||
auto inquote = false;
|
auto inquote = false;
|
||||||
|
|
Loading…
Reference in New Issue