aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTristan Riehs <tristan.riehs@inria.fr>2025-12-27 21:56:39 +0100
committerTristan Riehs <tristan.riehs@inria.fr>2025-12-27 21:56:39 +0100
commit8043109f7eeb2a48bf1e2404278d8bc4af9a5634 (patch)
tree6cab0ef59129a287c18427a4df5ae104a93c8753 /src
parentc33cc7d931026b5855c01494b16640b843dd307a (diff)
Add "ftag file help" command
Diffstat (limited to 'src')
-rw-r--r--src/main.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/main.c b/src/main.c
index beb39c0..460894e 100644
--- a/src/main.c
+++ b/src/main.c
@@ -531,6 +531,16 @@ step4:
sqlite3_close(db);
}
+static void ftag_file_help(int, char **)
+{
+ printf("Usage: ftag file COMMAND [ARG]...\n");
+ printf("Available values for COMMAND:\n");
+ printf(" add add files to the database\n");
+ printf(" help print this help\n");
+ printf(" list list files in the database\n");
+ printf(" tag add tags to files\n");
+}
+
static void ftag_file_list(int argc, char **argv)
{
ftag_list_table("files", "full_name");
@@ -597,9 +607,10 @@ static void ftag_file(int argc, char **argv)
{
assert_db_exists();
const struct ftag_command file_commands[] = {
- {.name = "add", .func = ftag_file_add},
+ {.name = "add", .func = ftag_file_add},
+ {.name = "help", .func = ftag_file_help},
{.name = "list", .func = ftag_file_list},
- {.name = "tag", .func = ftag_file_tag}
+ {.name = "tag", .func = ftag_file_tag}
/* TODO: add help command */
};
const int file_command_count = sizeof(file_commands)/ sizeof(struct ftag_command);