Let interactive imply verification
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
15
src/main.rs
15
src/main.rs
@@ -93,16 +93,12 @@ fn parse_min_size(input: &str) -> Result<u64, String> {
|
||||
|
||||
fn main() -> anyhow::Result<ExitCode> {
|
||||
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<ExitCode> {
|
||||
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<ExitCode> {
|
||||
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 {
|
||||
|
||||
Reference in New Issue
Block a user