diff options
Diffstat (limited to 'src/cmd.c')
-rw-r--r-- | src/cmd.c | 20 |
1 files changed, 17 insertions, 3 deletions
@@ -62,7 +62,7 @@ static void F(help), F(shell), F(action), F(add), F(rawsend), F(rawprint), F(rebind), F(rebindall), F(rebindALL), F(record), F(request), F(reset), F(retrace), F(save), F(send), F(setvar), F(snoop), F(spawn), F(stop), - F(time), F(var), F(ver), F(while), F(write), + F(substitute), F(time), F(var), F(ver), F(while), F(write), F(eval), F(zap), F(module), F(group), F(speedwalk), F(groupdelim); #ifdef BUG_TELNET @@ -227,6 +227,8 @@ cmdstruct default_commands[] = "connect-id command\ttalk with a shell command"), C("speedwalk", cmd_speedwalk, "[speedwalk sequence]\texecute a speedwalk sequence explicitly"), + C("substitute", cmd_substitute, + "[string[=[text]]]\tdelete/list/define substitutions"), C("stop", cmd_stop, "\t\t\t\tremove all delayed commands from active list"), C("time", cmd_time, @@ -1281,6 +1283,12 @@ static void cmd_reset(char *arg) if (!all) return; } + if (all || !strcmp(arg, "substitute")) { + while (substitutions) + delete_substnode(&substitutions); + if (!all) + return; + } if (all || !strcmp(arg, "var")) { int n; varnode **first; @@ -1335,6 +1343,14 @@ static void cmd_stop(char *arg) } } +static void cmd_substitute(char *arg) +{ + if (!*arg) + show_substitutions(); + else + parse_substitute(arg); +} + static void cmd_time(char *arg) { struct tm *s; @@ -2709,5 +2725,3 @@ static void cmd_put(char *arg) put_history(arg); ptrdel(pbuf); } - - |