Skip to content

Commit 23f203a

Browse files
committed
Duplicates files in CLI shouldn't delete files by default
1 parent 67a775b commit 23f203a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

czkawka_cli/src/commands.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ pub enum Commands {
1818
allowed_extensions: AllowedExtensions,
1919
#[structopt(short, long, default_value = "HASH", parse(try_from_str = parse_checking_method), help = "Search method (SIZE, HASH, HASHMB)", long_help = "Methods to search files.\nSIZE - The fastest method, checking by the file's size,\nHASHMB - More accurate but slower, checking by the hash of the file's first mibibyte or\nHASH - The slowest method, checking by the hash of the entire file")]
2020
search_method: CheckingMethod,
21-
#[structopt(short = "D", long, default_value = "AEO", parse(try_from_str = parse_delete_method), help = "Delete method (AEN, AEO, ON, OO)", long_help = "Methods to delete the files.\nAEN - All files except the newest,\nAEO - All files except the oldest,\nON - Only 1 file, the newest,\nOO - Only 1 file, the oldest")]
21+
#[structopt(short = "D", long, default_value = "NONE", parse(try_from_str = parse_delete_method), help = "Delete method (AEN, AEO, ON, OO)", long_help = "Methods to delete the files.\nAEN - All files except the newest,\nAEO - All files except the oldest,\nON - Only 1 file, the newest,\nOO - Only 1 file, the oldest\nNONE - not delete files")]
2222
delete_method: DeleteMethod,
2323
#[structopt(flatten)]
2424
file_to_save: FileToSave,
@@ -147,6 +147,7 @@ fn parse_checking_method(src: &str) -> Result<CheckingMethod, &'static str> {
147147

148148
fn parse_delete_method(src: &str) -> Result<DeleteMethod, &'static str> {
149149
match src.to_ascii_lowercase().as_str() {
150+
"none" => Ok(DeleteMethod::None),
150151
"aen" => Ok(DeleteMethod::AllExceptNewest),
151152
"aeo" => Ok(DeleteMethod::AllExceptOldest),
152153
"on" => Ok(DeleteMethod::OneNewest),

0 commit comments

Comments
 (0)