aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTristan Riehs <tristan.riehs@inria.fr>2025-11-30 12:15:25 +0100
committerTristan Riehs <tristan.riehs@inria.fr>2025-11-30 12:15:25 +0100
commit6204236c0e4afc99b40a40d1e81f4c9b71fde387 (patch)
treea8f224cecf36d77cbfe05a0ef2047c34b0cded3a
parent14addaafbf49baf23ddbed3e92a2ef4ef7f7a4f8 (diff)
Abandon dynamic help message construction idea
Manually creating every help message is much easier and not so less clean and more tedious.
-rw-r--r--src/main.c7
1 files changed, 3 insertions, 4 deletions
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);