chore: no_preserve instead of no_preserve_root

This commit is contained in:
Muhammad Nauman Raza 2024-03-13 20:05:55 +00:00
parent 43667b337e
commit 40b30bd9d8
Signed by: devraza
GPG key ID: 91EAD6081011574B

View file

@ -9,7 +9,7 @@ struct Args {
recursive: bool,
#[arg(long)]
no_preserve_root: bool,
no_preserve: bool,
#[arg(trailing_var_arg = true, allow_hyphen_values = false)]
targets: Vec<String>,
@ -25,7 +25,7 @@ fn main() -> std::io::Result<()> {
}
for target in args.targets.iter() {
if args.no_preserve_root == false {
if args.no_preserve == false {
if target == "/" || target == "~" {
println!("{} you're trying to delete an important directory ({})! specify '--no-preserve-root' if you really want to do this", "error:".red().bold(), target);
process::exit(0);