mirror of
https://github.com/nushell/nushell.git
synced 2024-11-08 09:34:30 +01:00
Edit rm
help messages (#7165)
* Edit `rm` help messages * Restore accidental missing changes
This commit is contained in:
parent
ced5e1065f
commit
587536ddcc
@ -36,7 +36,7 @@ impl Command for Rm {
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
"Remove file(s)."
|
||||
"Remove files and directories."
|
||||
}
|
||||
|
||||
fn search_terms(&self) -> Vec<&str> {
|
||||
@ -53,21 +53,17 @@ impl Command for Rm {
|
||||
let sig = sig
|
||||
.switch(
|
||||
"trash",
|
||||
"use the platform's recycle bin instead of permanently deleting",
|
||||
"move to the platform's trash instead of permanently deleting",
|
||||
Some('t'),
|
||||
)
|
||||
.switch(
|
||||
"permanent",
|
||||
"don't use recycle bin, delete permanently",
|
||||
"delete permanently, ignoring the 'always_trash' config option",
|
||||
Some('p'),
|
||||
);
|
||||
sig.switch("recursive", "delete subdirectories recursively", Some('r'))
|
||||
.switch("force", "suppress error when no file", Some('f'))
|
||||
.switch(
|
||||
"verbose",
|
||||
"make rm to be verbose, showing files been deleted",
|
||||
Some('v'),
|
||||
)
|
||||
.switch("verbose", "print names of deleted files", Some('v'))
|
||||
.switch("interactive", "ask user to confirm action", Some('i'))
|
||||
.rest(
|
||||
"rest",
|
||||
@ -90,7 +86,7 @@ impl Command for Rm {
|
||||
fn examples(&self) -> Vec<Example> {
|
||||
let mut examples = vec![Example {
|
||||
description:
|
||||
"Delete or move a file to the trash (depending on 'always_trash' config option)",
|
||||
"Delete, or move a file to the trash (based on the 'always_trash' config option)",
|
||||
example: "rm file.txt",
|
||||
result: None,
|
||||
}];
|
||||
@ -101,21 +97,27 @@ impl Command for Rm {
|
||||
))]
|
||||
examples.append(&mut vec![
|
||||
Example {
|
||||
description: "Move a file to the system trash",
|
||||
description: "Move a file to the trash",
|
||||
example: "rm --trash file.txt",
|
||||
result: None,
|
||||
},
|
||||
Example {
|
||||
description: "Delete a file permanently",
|
||||
description:
|
||||
"Delete a file permanently, even if the 'always_trash' config option is true",
|
||||
example: "rm --permanent file.txt",
|
||||
result: None,
|
||||
},
|
||||
]);
|
||||
examples.push(Example {
|
||||
description: "Delete a file, and suppress errors if no file is found",
|
||||
description: "Delete a file, ignoring 'file not found' errors",
|
||||
example: "rm --force file.txt",
|
||||
result: None,
|
||||
});
|
||||
examples.push(Example {
|
||||
description: "Delete all 0KB files in the current directory",
|
||||
example: "ls | where size == 0KB && type == file | each { rm $in.name } | null",
|
||||
result: None,
|
||||
});
|
||||
examples
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user