mirror of
https://github.com/nushell/nushell.git
synced 2025-07-01 15:11:52 +02:00
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:
committed by
GitHub
parent
0a5f41abc2
commit
435348aa61
@ -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,
|
||||
|
Reference in New Issue
Block a user