From: Not Zed Date: Wed, 20 Dec 2023 08:55:18 +0000 (+1030) Subject: Implement disk filtering for --files. X-Git-Url: https://code.zedzone.au/cvs?a=commitdiff_plain;h=e8adf67923634ce526a601bc2c9988edb4708d5d;p=playerz Implement disk filtering for --files. Rename -d database option to non-conflicting -b database. --- 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); }