diff options
| author | Thorsten Töpper <atsutane@freethoughts.de> | 2026-03-02 19:16:10 +0100 |
|---|---|---|
| committer | Thorsten Töpper <atsutane@freethoughts.de> | 2026-03-02 19:16:10 +0100 |
| commit | 2bf2617203e2dded958bdf2f0e1825b689e2f83c (patch) | |
| tree | 6477c0754afdc8f82e90cd211402a6159a938888 /src/options.c | |
| parent | b5e349ec046d40b1319357e07998b76d6df2911b (diff) | |
| download | duplicate_finder-2bf2617203e2dded958bdf2f0e1825b689e2f83c.tar.gz duplicate_finder-2bf2617203e2dded958bdf2f0e1825b689e2f83c.tar.bz2 | |
Diffstat (limited to 'src/options.c')
| -rw-r--r-- | src/options.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/options.c b/src/options.c index 0b55df1..cb39442 100644 --- a/src/options.c +++ b/src/options.c @@ -19,6 +19,7 @@ struct option long_options[] = { { "all", no_argument, 0, 0 }, { "database", required_argument, 0 ,0 }, + { "force-scan", no_argument, 0, 0 }, { "help", no_argument, 0, 0 }, { "kv-storage", required_argument, 0, 0}, { "new-kv", no_argument, 0, 0 }, @@ -28,6 +29,7 @@ struct option long_options[] = { enum operation_modes option_mode = MODE_DEV_MESSED_UP; bool option_clean_kv = false; +bool option_force_scan = false; bool option_quiet = false; bool option_show_hidden_entries = false; bool option_show_non_duplicates = false; @@ -46,6 +48,8 @@ void usage(char *executable) { "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", "--force-scan", "-f", "", + "Don't skip processing files in scan mode if their DB entry matches metadata"); fprintf(stderr, " %-25s %2s %10s - %s\n", "--help", "-h", "", "Show this message and exit"); fprintf(stderr, " %-25s %2s %10s - %s\n", "--kv-storage", "-k", "", @@ -78,6 +82,11 @@ void set_option(const char *option_name, char *option_argument) { return; /* options WITHOUT arguments */ + if (strcmp("force-scan", option_name) == 0) { + option_force_scan = true; + return; + } + if (strcmp("help", option_name) == 0) { usage(exec_name); exit(EXIT_SUCCESS); @@ -123,7 +132,7 @@ int parse_arguments(int argc, char **argv) { while(1) { index = 0; - c = getopt_long(argc, argv, "ad:hk:q", long_options, &index); + c = getopt_long(argc, argv, "ad:fhk:q", long_options, &index); if (c == -1) { break; @@ -139,6 +148,9 @@ int parse_arguments(int argc, char **argv) { case 'd': option_sqlite_db_name = optarg; break; + case 'f': + option_force_scan = true; + break; case 'h': usage(exec_name); exit(EXIT_SUCCESS); |
