summary refs log tree commit diff
path: root/command.c
diff options
context:
space:
mode:
Diffstat (limited to 'command.c')
-rw-r--r--command.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/command.c b/command.c
index 41aacc9..8bd8b28 100644
--- a/command.c
+++ b/command.c
@@ -125,7 +125,12 @@ void command(size_t id, char *input) {
 	} else if (input[0] == '/' && isdigit(input[1])) {
 		commandWindow(id, &input[1]);
 	} else {
-		char *cmd = strsep(&input, " ");
+		const char *cmd = strsep(&input, " ");
+		const char *unique = complete(None, cmd);
+		if (unique && !complete(None, cmd)) {
+			cmd = unique;
+			completeReject();
+		}
 		const struct Handler *handler = bsearch(
 			cmd, Commands, ARRAY_LEN(Commands), sizeof(*handler), compar
 		);
>Day 8June McEnroe 2020-11-22Day 7, part 2June McEnroe I don't even know what this is. Don't look at it. 2020-11-22Day 7June McEnroe 2020-11-22Day 6, part 2June McEnroe 2020-11-22Day 6June McEnroe 2020-11-22Day 5, part 2June McEnroe 2020-11-22Day 5June McEnroe 2020-11-22Day 4, part 2June McEnroe That ugly sort map though. 2020-11-22Day 4June McEnroe 2020-11-22Day 3, part 2June McEnroe I am super surprised that worked on the first try. 2020-11-22Day 3, clean upJune McEnroe 2020-11-22Day 3June McEnroe This is fucking awful and I'm angry. 2020-11-22Day 2, part 2June McEnroe 2020-11-22Day 2June McEnroe 2020-11-22Day 1, part 2June McEnroe 2020-11-22Day 1June McEnroe 2020-11-22Move to 2016 directoryJune McEnroe