Grouped config commands better (closes #6911) (#6983)

* Grouped config commands better

* Tweaked test slightly

* Fix merge conflict(?)

* Remove recently-added test case

* Revert rm.always_trash default

* Untweak rm help messages

* Formatting

* Remove example

* Add deprecation warning

* Remove deprecation timeline

Not sure we want to commit to a specific timeline just yet

Co-authored-by: Reilly Wood <26268125+rgwood@users.noreply.github.com>
This commit is contained in:
Leon
2022-11-20 03:52:09 +10:00
committed by GitHub
parent 4b83a2d27a
commit 7479173811
3 changed files with 557 additions and 189 deletions

View File

@ -88,12 +88,12 @@ impl Command for Rm {
}
fn examples(&self) -> Vec<Example> {
let mut examples = vec![
Example {
description: "Delete or move a file to the system trash (depending on 'rm_always_trash' config option)",
example: "rm file.txt",
result: None,
}];
let mut examples = vec![Example {
description:
"Delete or move a file to the trash (depending on 'always_trash' config option)",
example: "rm file.txt",
result: None,
}];
#[cfg(all(
feature = "trash-support",
not(target_os = "android"),
@ -164,7 +164,7 @@ fn rm(
if rm_always_trash {
return Err(ShellError::GenericError(
"Cannot execute `rm`; the current configuration specifies \
`rm_always_trash = true`, but the current nu executable was not \
`always_trash = true`, but the current nu executable was not \
built with feature `trash_support` or trash is not supported on \
your platform."
.into(),