Alias /n to /view n where n is a number

master
Curtis McEnroe 2018-08-18 18:31:51 -04:00
parent 6ec3c3011e
commit e29f67dde5
No known key found for this signature in database
GPG Key ID: CEA2F97ADCFCD77C
1 changed files with 8 additions and 1 deletions

View File

@ -178,8 +178,15 @@ void input(struct Tag tag, char *input) {
COMMANDS[i].handler(tag, input); COMMANDS[i].handler(tag, input);
return; return;
} }
char *trail;
strtol(&command[1], &trail, 0);
if (!trail[0]) {
inputView(tag, &command[1]);
} else {
uiFmt(TAG_STATUS, UI_WARM, "%s isn't a recognized command", command); uiFmt(TAG_STATUS, UI_WARM, "%s isn't a recognized command", command);
} }
}
void inputTab(void) { void inputTab(void) {
for (size_t i = 0; i < COMMANDS_LEN; ++i) { for (size_t i = 0; i < COMMANDS_LEN; ++i) {