Add support for custom command aliases, this is an array option which

contains items of the form "alias=command". This is consulted when an
unknown command is parsed.
This commit is contained in:
nicm
2017-01-24 19:53:37 +00:00
parent 61fce272ea
commit 85338bb75f
6 changed files with 91 additions and 47 deletions

View File

@ -252,16 +252,13 @@ client_main(struct event_base *base, int argc, char **argv, int flags,
* flag.
*/
cmdlist = cmd_list_parse(argc, argv, NULL, 0, &cause);
if (cmdlist == NULL) {
fprintf(stderr, "%s\n", cause);
return (1);
if (cmdlist != NULL) {
TAILQ_FOREACH(cmd, &cmdlist->list, qentry) {
if (cmd->entry->flags & CMD_STARTSERVER)
cmdflags |= CMD_STARTSERVER;
}
cmd_list_free(cmdlist);
}
cmdflags &= ~CMD_STARTSERVER;
TAILQ_FOREACH(cmd, &cmdlist->list, qentry) {
if (cmd->entry->flags & CMD_STARTSERVER)
cmdflags |= CMD_STARTSERVER;
}
cmd_list_free(cmdlist);
}
/* Create client process structure (starts logging). */