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

@ -1,7 +1,7 @@
use nu_protocol::{
ast::Call,
engine::{EngineState, Stack},
Example, IntoPipelineData, PipelineData, Signature, Span, SyntaxShape, Value,
Category, Example, IntoPipelineData, PipelineData, Signature, Span, SyntaxShape, Value,
};
use std::{collections::HashMap, fmt::Write};
@ -94,8 +94,8 @@ fn get_documentation(
let signatures = engine_state.get_signatures(true);
for sig in signatures {
if sig.name.starts_with(&format!("{cmd_name} "))
// Don't display deprecated commands in the Subcommands list
&& !sig.usage.starts_with("Deprecated command")
// Don't display removed/deprecated commands in the Subcommands list
&& !matches!(sig.category, Category::Removed)
{
subcommands.push(format!(" {C}{}{RESET} - {}", sig.name, sig.usage));
}