deprecated commands (#4405)

* deprecated commands

* deprecated insert command
This commit is contained in:
Fernando Herrera
2022-02-10 12:55:19 +00:00
committed by GitHub
parent 28947ff9a9
commit 5cf91cb30d
11 changed files with 257 additions and 0 deletions

View File

@ -267,6 +267,14 @@ pub enum ShellError {
#[error("{0}")]
#[diagnostic(help("{1}"))]
LabeledError(String, String),
#[error("Deprecated command {0}")]
#[diagnostic(code(nu::shell::deprecated_command), url(docsrs))]
DeprecatedCommand(
String,
String,
#[label = "{0} is deprecated. Instead use {1}"] Span,
),
}
impl From<std::io::Error> for ShellError {

View File

@ -52,6 +52,7 @@ pub enum Category {
Hash,
Generators,
Custom(String),
Deprecated,
}
impl std::fmt::Display for Category {
@ -77,6 +78,7 @@ impl std::fmt::Display for Category {
Category::Hash => "hash",
Category::Generators => "generators",
Category::Custom(name) => name,
Category::Deprecated => "deprecated",
};
write!(f, "{}", msg)