diff --git a/crates/nu-cli/src/commands/rm.rs b/crates/nu-cli/src/commands/rm.rs index a48adce27..e676cf946 100644 --- a/crates/nu-cli/src/commands/rm.rs +++ b/crates/nu-cli/src/commands/rm.rs @@ -14,6 +14,8 @@ pub struct RemoveArgs { pub recursive: Tagged, #[allow(unused)] pub trash: Tagged, + #[allow(unused)] + pub permanent: Tagged, } #[async_trait] @@ -29,6 +31,11 @@ impl WholeStreamCommand for Remove { "use the platform's recycle bin instead of permanently deleting", Some('t'), ) + .switch( + "permanent", + "don't use recycle bin, delete permanently", + Some('p'), + ) .switch("recursive", "delete subdirectories recursively", Some('r')) .rest(SyntaxShape::Pattern, "the file path(s) to remove") } @@ -48,7 +55,7 @@ impl WholeStreamCommand for Remove { fn examples(&self) -> Vec { vec![ Example { - description: "Delete a file", + description: "Delete or move a file to the system trash (depending on 'rm_always_trash' config option)", example: "rm file.txt", result: None, }, @@ -57,6 +64,11 @@ impl WholeStreamCommand for Remove { example: "rm --trash file.txt", result: None, }, + Example { + description: "Delete a file permanently", + example: "rm --permanent file.txt", + result: None, + }, ] } } @@ -67,7 +79,15 @@ fn rm(args: CommandArgs, registry: &CommandRegistry) -> Result