about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2018-08-18 18:31:51 -0400
committerJune McEnroe <june@causal.agency>2018-08-18 18:31:51 -0400
commite29f67dde5c1ec8a76259b3f062a49deab028054 (patch)
tree02e1f6680d38e04a2c1f54933fa009127688b65a
parentDo not set log files executable (diff)
downloadtest-e29f67dde5c1ec8a76259b3f062a49deab028054.tar.gz
test-e29f67dde5c1ec8a76259b3f062a49deab028054.zip
Alias /n to /view n where n is a number
-rw-r--r--input.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/input.c b/input.c
index cb0a12c..c6ceb88 100644
--- a/input.c
+++ b/input.c
@@ -178,7 +178,14 @@ void input(struct Tag tag, char *input) {
 		COMMANDS[i].handler(tag, input);
 		return;
 	}
-	uiFmt(TAG_STATUS, UI_WARM, "%s isn't a recognized command", command);
+
+	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);
+	}
 }
 
 void inputTab(void) {
r> 2017-07-31Add tupJune McEnroe 2017-07-31Use designated initializer for hnel tableJune McEnroe I did not know this syntax worked! 2017-07-30Add juneJune McEnroe 2017-07-30Play nethack as ValkyrieJune McEnroe 2017-07-28Add toggle to hnelJune McEnroe 2017-07-28Install slJune McEnroe 2017-07-25Add up, supJune McEnroe 2017-07-24Autopickup ringsJune McEnroe 2017-07-24Name dogJune McEnroe 2017-07-23Add nethackrcJune McEnroe 2017-07-23Remove useless setuid in briJune McEnroe Don't you think it would be better if the setuid bit only gave you permission to do it and didn't do it for you? 2017-07-23Clean up hnel a tiny bitJune McEnroe 2017-07-21Set window size in hnelJune McEnroe 2017-07-21Add hnelJune McEnroe 2017-07-19chmod 600 in dtchJune McEnroe