X-Git-Url: http://git.bytex64.net/?a=blobdiff_plain;f=blergtool.c;h=d5aef50f9f26e2b7677f22b8ef324f7f78705a10;hb=f10cc7cf39e0aa34583d4d5811615211660edc8c;hp=a0148c0d78bb0d8127cf0c571e0117c6e8e044e6;hpb=c18e5d36dc4788195df4bdaf536efde3a1a3d780;p=blerg.git diff --git a/blergtool.c b/blergtool.c index a0148c0..d5aef50 100644 --- a/blergtool.c +++ b/blergtool.c @@ -1,6 +1,7 @@ #include #include #include "database.h" +#include "tags.h" void help() { printf("Usage: blergtool [record]\n"); @@ -50,6 +51,19 @@ int main(int argc, char *argv[]) { blerg_close(f); fwrite(data, 1, size, stdout); free(data); + } else if (strncmp(argv[1], "list", 4) == 0) { + char *tag = argv[2]; + uint64_t count = 50; + struct tag *list = tag_list(tag, 0, &count, -1); + if (list == NULL) { + printf("No entries"); + } else { + int i; + for (i = 0; i < count; i++) { + printf("%s %d\n", list[i].author, list[i].record); + } + free(list); + } } else { help(); }