From 5d4e2823178c04fb398159c808f2de493dcb2c3b Mon Sep 17 00:00:00 2001 From: Tristan Riehs Date: Sun, 30 Nov 2025 12:28:48 +0100 Subject: Resort to help command when no other command matches --- src/main.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/main.c') diff --git a/src/main.c b/src/main.c index fe5db7d..7bae17c 100644 --- a/src/main.c +++ b/src/main.c @@ -639,8 +639,13 @@ static void parse_args(int argc, return; } } - fprintf(stderr, "ftag: command \"%s\" unknown\n", argv[0]); + for (int i = 0; i < command_count; i++) { + if (strcmp(commands[i].name, "help") == 0) { + commands[i].func(0, NULL); + break; + } + } exit(EXIT_FAILURE); } -- cgit v1.2.3