aboutsummaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
authorTristan Riehs <tristan.riehs@inria.fr>2025-11-30 12:28:48 +0100
committerTristan Riehs <tristan.riehs@inria.fr>2025-11-30 12:29:19 +0100
commit5d4e2823178c04fb398159c808f2de493dcb2c3b (patch)
treef41e75bd78e1268245eb0412c2db928b49dd6dd4 /src/main.c
parentcb6c62a7080fe7384adbd5af5ce2893b48194751 (diff)
Resort to help command when no other command matches
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c7
1 files changed, 6 insertions, 1 deletions
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);
}