From 819779a68bc6da0c3d298efe52e3b1ca0d2e66cf Mon Sep 17 00:00:00 2001 From: Thorsten Töpper Date: Tue, 24 Feb 2026 23:52:29 +0100 Subject: By default suppress unrequired output when doing analysis --- include/options.h | 1 + src/duplicate_finder.c | 8 +++++--- src/options.c | 4 +++- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/include/options.h b/include/options.h index 7e8ec38..4a2c806 100644 --- a/include/options.h +++ b/include/options.h @@ -27,6 +27,7 @@ enum operation_modes { extern bool option_quiet; extern bool option_show_hidden_entries; +extern bool option_show_non_duplicates; extern bool option_clean_kv; extern char *option_gdbm_db_name; extern char *option_sqlite_db_name; diff --git a/src/duplicate_finder.c b/src/duplicate_finder.c index f410f59..c6843f0 100644 --- a/src/duplicate_finder.c +++ b/src/duplicate_finder.c @@ -44,10 +44,12 @@ int analyze_db_content() { } - /* TODO: Implementation of several SQL queries... not in the mood */ - dbi_print_fileinfo_resolved(stdout); + if (option_show_non_duplicates) { + dbi_print_fileinfo_resolved(stdout); + printf("\n\n"); + } - printf("\n\n---- IDENTICAL HASHES ----\n\n"); + printf("---- IDENTICAL HASHES ----\n\n"); if (dbi_print_identical_hashes(stdout) < 0) { LOGERR("ERROR: Identification of duplicates via hashes failed.\n"); diff --git a/src/options.c b/src/options.c index 3f226d3..3c8023c 100644 --- a/src/options.c +++ b/src/options.c @@ -30,6 +30,7 @@ enum operation_modes option_mode = MODE_DEV_MESSED_UP; bool option_clean_kv = false; bool option_quiet = false; bool option_show_hidden_entries = false; +bool option_show_non_duplicates = false; char *option_gdbm_db_name = "/tmp/duplicate_finder.gdbm"; char *option_sqlite_db_name = "duplicate_finder.sqlite"; @@ -42,7 +43,7 @@ void usage(char *executable) { fprintf(stderr, "\nOPTIONS are\n"); /* long name, short name, optional argument, explanation */ fprintf(stderr, " %-25s %2s %10s - %s\n", "--all", "-a", "", - "Also process and show files hidden on the filesystem"); + "Different per command, scan includes hidden files, analyze shows every db entry before analysis"); fprintf(stderr, " %-25s %2s %10s - %s\n", "--database", "-d", "", "fullname of the sqlite db to be used"); fprintf(stderr, " %-25s %2s %10s - %s\n", "--help", "-h", "", @@ -63,6 +64,7 @@ void set_option(const char *option_name, char *option_argument) { if (strcmp("all", option_name) == 0) { option_show_hidden_entries = true; + option_show_non_duplicates = true; return; } if (option_name == NULL) -- cgit v1.3