Compare commits
1 Commits
ab14a9d891
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| cb29678285 |
@@ -64,13 +64,13 @@ disk-checker ~/Downloads --verify-full
|
|||||||
Review duplicate groups one by one and choose which path to keep:
|
Review duplicate groups one by one and choose which path to keep:
|
||||||
|
|
||||||
```bash
|
```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
|
```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:
|
Use the fastest triage mode for huge datasets by grouping same-size files without hashing:
|
||||||
|
|||||||
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> {
|
fn main() -> anyhow::Result<ExitCode> {
|
||||||
let cli = Cli::parse();
|
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 {
|
if cli.interactive && cli.json {
|
||||||
bail!(
|
bail!(
|
||||||
"--interactive cannot be combined with --json because prompts would contaminate JSON output"
|
"--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 {
|
if let Some(threads) = cli.threads {
|
||||||
rayon::ThreadPoolBuilder::new()
|
rayon::ThreadPoolBuilder::new()
|
||||||
@@ -121,7 +117,7 @@ fn main() -> anyhow::Result<ExitCode> {
|
|||||||
paths,
|
paths,
|
||||||
hash_bytes: cli.hash_bytes,
|
hash_bytes: cli.hash_bytes,
|
||||||
follow_links: cli.follow_links,
|
follow_links: cli.follow_links,
|
||||||
verify_full: cli.verify_full,
|
verify_full,
|
||||||
threads: cli.threads,
|
threads: cli.threads,
|
||||||
size_only: cli.size_only,
|
size_only: cli.size_only,
|
||||||
min_size: cli.min_size,
|
min_size: cli.min_size,
|
||||||
@@ -140,12 +136,7 @@ fn main() -> anyhow::Result<ExitCode> {
|
|||||||
drop(out);
|
drop(out);
|
||||||
|
|
||||||
if cli.interactive {
|
if cli.interactive {
|
||||||
let groups = if cli.verify_full {
|
run_interactive_resolver(&report.verified_duplicates, true, &cli.delete_plan)?;
|
||||||
&report.verified_duplicates
|
|
||||||
} else {
|
|
||||||
&report.possible_duplicates
|
|
||||||
};
|
|
||||||
run_interactive_resolver(groups, cli.verify_full, &cli.delete_plan)?;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if report.summary.errors > 0 {
|
if report.summary.errors > 0 {
|
||||||
|
|||||||
Reference in New Issue
Block a user