From cb29678285fb41dfe9fa96d92b4346facf8c7653 Mon Sep 17 00:00:00 2001 From: repi Date: Thu, 4 Jun 2026 15:34:48 +0100 Subject: [PATCH] Let interactive imply verification Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode) Co-authored-by: Sisyphus --- README.md | 6 +++--- src/main.rs | 15 +++------------ 2 files changed, 6 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index b447576..55bb7bc 100644 --- a/README.md +++ b/README.md @@ -64,13 +64,13 @@ disk-checker ~/Downloads --verify-full Review duplicate groups one by one and choose which path to keep: ```bash -disk-checker ~/Downloads --verify-full --interactive +disk-checker ~/Downloads --interactive ``` -Interactive mode requires `--verify-full` and is non-destructive: it writes a reviewed shell deletion plan instead of deleting files immediately. +Interactive mode automatically full-verifies only the duplicate candidate groups before prompting. It is non-destructive: it writes a reviewed shell deletion plan instead of deleting files immediately. ```bash -disk-checker ~/Downloads --verify-full --interactive --delete-plan review-delete.sh +disk-checker ~/Downloads --interactive --delete-plan review-delete.sh ``` Use the fastest triage mode for huge datasets by grouping same-size files without hashing: diff --git a/src/main.rs b/src/main.rs index 2cc9915..6895d6c 100644 --- a/src/main.rs +++ b/src/main.rs @@ -93,16 +93,12 @@ fn parse_min_size(input: &str) -> Result { fn main() -> anyhow::Result { let cli = Cli::parse(); - if cli.interactive && !cli.verify_full { - bail!( - "--interactive requires --verify-full so keep/delete plans are based on fully verified duplicates" - ); - } if cli.interactive && cli.json { bail!( "--interactive cannot be combined with --json because prompts would contaminate JSON output" ); } + let verify_full = cli.verify_full || cli.interactive; if let Some(threads) = cli.threads { rayon::ThreadPoolBuilder::new() @@ -121,7 +117,7 @@ fn main() -> anyhow::Result { paths, hash_bytes: cli.hash_bytes, follow_links: cli.follow_links, - verify_full: cli.verify_full, + verify_full, threads: cli.threads, size_only: cli.size_only, min_size: cli.min_size, @@ -140,12 +136,7 @@ fn main() -> anyhow::Result { drop(out); if cli.interactive { - let groups = if cli.verify_full { - &report.verified_duplicates - } else { - &report.possible_duplicates - }; - run_interactive_resolver(groups, cli.verify_full, &cli.delete_plan)?; + run_interactive_resolver(&report.verified_duplicates, true, &cli.delete_plan)?; } if report.summary.errors > 0 {