diff options
| author | Tristan Riehs <tristan.riehs@inria.fr> | 2025-11-30 12:28:48 +0100 |
|---|---|---|
| committer | Tristan Riehs <tristan.riehs@inria.fr> | 2025-11-30 12:29:19 +0100 |
| commit | 5d4e2823178c04fb398159c808f2de493dcb2c3b (patch) | |
| tree | f41e75bd78e1268245eb0412c2db928b49dd6dd4 | |
| parent | cb6c62a7080fe7384adbd5af5ce2893b48194751 (diff) | |
Resort to help command when no other command matches
| -rw-r--r-- | src/main.c | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -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); } |
