From 6204236c0e4afc99b40a40d1e81f4c9b71fde387 Mon Sep 17 00:00:00 2001 From: Tristan Riehs Date: Sun, 30 Nov 2025 12:15:25 +0100 Subject: Abandon dynamic help message construction idea Manually creating every help message is much easier and not so less clean and more tedious. --- src/main.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/main.c') diff --git a/src/main.c b/src/main.c index 19da071..cd18f11 100644 --- a/src/main.c +++ b/src/main.c @@ -19,9 +19,6 @@ struct ftag_command { /* Execute the command, eventually by parsing some options. FUNC may * shift ARGC and ARGV and call parse_args again. */ void (*func)(int argc, char **argv); - /* TODO: add help string - * This will allow dynamically generating the help message, - * maybe also add child ftag_commands */ }; /* Parse arguments using an array of available commands. ARGV[0] has to match @@ -409,6 +406,7 @@ static void ftag_file(int argc, char **argv) {.name = "add", .func = ftag_file_add}, {.name = "list", .func = ftag_file_list}, {.name = "tag", .func = ftag_file_tag} + /* TODO: add help command */ }; const int file_command_count = sizeof(file_commands)/ sizeof(struct ftag_command); parse_args(argc, argv, file_commands, file_command_count); @@ -416,7 +414,7 @@ static void ftag_file(int argc, char **argv) static void ftag_help(int, char **) { - printf("Usage: ftag COMMAND [COMMAND-ARG]...\n"); + printf("Usage: ftag COMMAND [ARG]...\n"); printf("Available values for COMMAND:\n"); printf(" init initialize the database\n"); printf(" file manage files\n"); @@ -620,6 +618,7 @@ static void ftag_tag(int argc, char **argv) {.name = "add", .func = ftag_tag_add}, {.name = "list", .func = ftag_tag_list} /* TODO: add an alias command */ + /* TODO: add help command */ }; int tag_command_count = sizeof(tag_commands) / sizeof(struct ftag_command); parse_args(argc, argv, tag_commands, tag_command_count); -- cgit v1.2.3