diff options
| -rw-r--r-- | cfg.def.h | 7 | ||||
| -rw-r--r-- | cmdtree.c | 1 | ||||
| -rw-r--r-- | command.c | 3 | ||||
| -rw-r--r-- | command.h | 1 |
4 files changed, 7 insertions, 5 deletions
@@ -45,7 +45,7 @@ static struct command browser_commands[] = { { .bind = "f", .name = "firefox", .nchildren = 0, .children = NULL }, }; -static const struct command commands[] = { +static struct command commands[] = { { .bind = "b", .name = "browsers", .nchildren = LENGTH(browser_commands), @@ -53,8 +53,9 @@ static const struct command commands[] = { }, { .bind = "e", - .name = "emacs-dev", - .children = NULL, + .name = "emacs", + .command = "emacs-dev", + .children = 0, .nchildren = 0 }, }; @@ -41,7 +41,6 @@ static XIC xic; #include "cfg.h" - static int cmdstack_push_(struct command *children, int nchildren) { if (cmdstack_ptr + 1 >= CMDSTACK_SIZE) @@ -17,7 +17,8 @@ command_is_prefix(struct command *cmd) { void command_exec(struct command *cmd) { - execlp("/bin/sh", "sh", "-c", cmd->name, (char *) 0); + const char *cmdname = cmd->command == NULL ? cmd->name : cmd->command; + execlp("/bin/sh", "sh", "-c", cmdname, (char *) 0); err(1, "executing command %s", cmd->name); } @@ -6,6 +6,7 @@ struct command { char *name; + char *command; char *bind; struct command *children; int nchildren; |
