From 00b576b7f1c97385d66337d620e340765578ead5 Mon Sep 17 00:00:00 2001 From: Ethan Brierley Date: Sat, 6 Apr 2024 02:28:40 +0100 Subject: [PATCH] Fix stop suggesting `--trash` when already enabled (issue #12361) (#12362) fixes #12361 Looking at the condition, `TRASH_SUPPORTED && (trash || (rm_always_trash && !permanent))`, this code path seems only to run when `--trash` is enabled and `--permanent` is disabled. This suggests that the `--trash` suggestion is a mistake and should have suggested `--permanent`. --- crates/nu-command/src/filesystem/rm.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/crates/nu-command/src/filesystem/rm.rs b/crates/nu-command/src/filesystem/rm.rs index 2795ebc947..6306eb959d 100644 --- a/crates/nu-command/src/filesystem/rm.rs +++ b/crates/nu-command/src/filesystem/rm.rs @@ -382,7 +382,10 @@ fn rm( ))] { trash::delete(&f).map_err(|e: trash::Error| { - Error::new(ErrorKind::Other, format!("{e:?}\nTry '--trash' flag")) + Error::new( + ErrorKind::Other, + format!("{e:?}\nTry '--permanent' flag"), + ) }) }