From 93c62efe54edfa721067b797492adfd45fcf1010 Mon Sep 17 00:00:00 2001 From: Tristan Riehs Date: Tue, 11 Nov 2025 18:30:07 +0100 Subject: Implement the tag list command Options to also enable displaying the description with be added int the future. --- src/main.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/main.c b/src/main.c index 4ea755c..e195bcf 100644 --- a/src/main.c +++ b/src/main.c @@ -129,9 +129,24 @@ static void ftag_tag_add(int argc, char **argv) sqlite3_check(rc, db); } +static int ftag_tag_print(void *, int, char **cols, char **) +{ + assert(cols[0]); + printf("%s\n", cols[0]); + return 0; +} + static void ftag_tag_list(int argc, char **argv) { - ; + const char *sql = "SELECT name FROM tags;"; + sqlite3 *db = NULL; + int rc; + + rc = sqlite3_open(DATABASE_PATH, &db); + sqlite3_check(rc, db); + + rc = sqlite3_exec(db, sql, ftag_tag_print, NULL, NULL); + sqlite3_check(rc, db); } static void ftag_tag(int argc, char **argv) -- cgit v1.2.3