nushell/crates/nu-command/src/removed/removed_commands.rs
Stefan Holderbach 435348aa61
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`
2023-08-15 07:17:31 +12:00

16 lines
602 B
Rust

use std::collections::HashMap;
/// Return map of <removed_command_name, new_command_name>
/// This covers simple removed commands nicely, but it's not great for deprecating
/// subcommands like `foo bar` where `foo` is still a valid command.
/// For those, it's currently easiest to have a "stub" command that just returns an error.
pub fn removed_commands() -> HashMap<String, String> {
[
("fetch".to_string(), "http get".to_string()),
("post".to_string(), "http post".to_string()),
("benchmark".to_string(), "timeit".to_string()),
]
.into_iter()
.collect()
}