Rename misused "deprecation" to removal (#10000)

# Description
In the past we named the process of completely removing a command and
providing a basic error message pointing to the new alternative
"deprecation".

But this doesn't match the expectation of most users that have seen
deprecation _warnings_ that alert to either impending removal or
discouraged use after a stability promise.

# User-Facing Changes
Command category changed from `deprecated` to `removed`
This commit is contained in:
Stefan Holderbach
2023-08-14 21:17:31 +02:00
committed by GitHub
parent 0a5f41abc2
commit 435348aa61
12 changed files with 33 additions and 51 deletions

View File

@ -295,15 +295,15 @@ impl ExternalCommand {
match err.kind() {
// If file not found, try suggesting alternative commands to the user
std::io::ErrorKind::NotFound => {
// recommend a replacement if the user tried a deprecated command
// recommend a replacement if the user tried a removed command
let command_name_lower = self.name.item.to_lowercase();
let deprecated = crate::deprecated_commands();
if deprecated.contains_key(&command_name_lower) {
let replacement = match deprecated.get(&command_name_lower) {
let removed_from_nu = crate::removed_commands();
if removed_from_nu.contains_key(&command_name_lower) {
let replacement = match removed_from_nu.get(&command_name_lower) {
Some(s) => s.clone(),
None => "".to_string(),
};
return Err(ShellError::DeprecatedCommand(
return Err(ShellError::RemovedCommand(
command_name_lower,
replacement,
self.name.span,