From e8adf67923634ce526a601bc2c9988edb4708d5d Mon Sep 17 00:00:00 2001 From: Not Zed Date: Wed, 20 Dec 2023 19:25:18 +1030 Subject: [PATCH] Implement disk filtering for --files. Rename -d database option to non-conflicting -b database. --- disk-util.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/disk-util.c b/disk-util.c index 8f2a44d..a2f8c9a 100644 --- a/disk-util.c +++ b/disk-util.c @@ -53,7 +53,7 @@ int main(int argc, char **argv) { setlocale(LC_ALL, "en_AU.UTF-8"); if (argc == 1) { - printf("usage: %s [-d database] options\n" + printf("usage: %s [-b database] options\n" " [ -f fileid ]\n" " [ -s seq ]\n" " [ -d diskid ] selectors\n" @@ -78,7 +78,7 @@ int main(int argc, char **argv) { return 0; } - if (argc > 2 && strcmp(argv[1], "-d") == 0) { + if (argc > 2 && strcmp(argv[1], "-b") == 0) { dbdir = argv[2]; argv += 2; argc -= 2; @@ -131,6 +131,8 @@ int main(int argc, char **argv) { dbscan scan; for (dbfile *file = dbscan_file(tx, &scan, db, fileid); file; file = dbscan_file_next(&scan)) { + if (diskid && file->diskid != diskid) + continue; printf("%4d %-60s '%s'\n", file->id, file->title, file->path); dbfile_free(file); } -- 2.39.5