diff options
| author | Tristan Riehs <tristan.riehs@inria.fr> | 2025-11-11 18:30:07 +0100 |
|---|---|---|
| committer | Tristan Riehs <tristan.riehs@inria.fr> | 2025-11-11 18:30:07 +0100 |
| commit | 93c62efe54edfa721067b797492adfd45fcf1010 (patch) | |
| tree | 343f45bed56c0807529ce06124c565fab1169070 /src | |
| parent | afb8845d25eb4104150193be691d4b60a051ec82 (diff) | |
Implement the tag list command
Options to also enable displaying the description with be added int the
future.
Diffstat (limited to 'src')
| -rw-r--r-- | src/main.c | 17 |
1 files changed, 16 insertions, 1 deletions
@@ -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) |
