From 7d0cae1a4e256230f5c199719099da36e858933e Mon Sep 17 00:00:00 2001 From: Muhammad Nauman Raza Date: Thu, 14 Mar 2024 19:19:40 +0000 Subject: [PATCH] chore: remove need for `-r` --- src/main.rs | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/src/main.rs b/src/main.rs index 9006c11..162ee8d 100644 --- a/src/main.rs +++ b/src/main.rs @@ -6,10 +6,6 @@ use colored::Colorize; #[command(version, about, long_about = None, author)] /// A simple, featureful and blazingly fast memory-safe alternative to 'rm' written in Rust. struct Args { - /// Recursively delete files and directories - #[arg(short, long)] - recursive: bool, - /// Don't try to preserve '~' or '/' #[arg(long)] no_preserve: bool, @@ -37,12 +33,7 @@ fn main() -> std::io::Result<()> { if path::Path::new(target).exists() { if fs::metadata(target).unwrap().is_dir() { - if args.recursive == false { - println!("{} could not remove directory {}, please specify '-r'", "error:".red().bold(), target); - process::exit(0); - } else { - let _ = fs::remove_dir_all(target); - } + let _ = fs::remove_dir_all(target); } else { let _ = fs::remove_file(target); }