mirror of
https://github.com/nushell/nushell.git
synced 2025-04-01 19:56:41 +02:00
Changed category for panic
and added search terms and examples (#13707)
# Description Cosmetic changes around `panic` command. Changed category, added search terms, and examples. # User-Facing Changes See above
This commit is contained in:
parent
1128df2d29
commit
71ced35987
@ -9,16 +9,22 @@ impl Command for Panic {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn description(&self) -> &str {
|
fn description(&self) -> &str {
|
||||||
"Executes a rust panic, useful only for testing."
|
"Causes nushell to panic."
|
||||||
|
}
|
||||||
|
|
||||||
|
fn search_terms(&self) -> Vec<&str> {
|
||||||
|
vec!["crash", "throw"]
|
||||||
}
|
}
|
||||||
|
|
||||||
fn signature(&self) -> nu_protocol::Signature {
|
fn signature(&self) -> nu_protocol::Signature {
|
||||||
Signature::build("panic")
|
Signature::build("panic")
|
||||||
.input_output_types(vec![(Type::Nothing, Type::table())])
|
.input_output_types(vec![(Type::Nothing, Type::Nothing)])
|
||||||
// LsGlobPattern is similar to string, it won't auto-expand
|
.optional(
|
||||||
// and we use it to track if the user input is quoted.
|
"msg",
|
||||||
.optional("msg", SyntaxShape::String, "The glob pattern to use.")
|
SyntaxShape::String,
|
||||||
.category(Category::Experimental)
|
"The custom message for the panic.",
|
||||||
|
)
|
||||||
|
.category(Category::Debug)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn run(
|
fn run(
|
||||||
@ -35,6 +41,10 @@ impl Command for Panic {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn examples(&self) -> Vec<Example> {
|
fn examples(&self) -> Vec<Example> {
|
||||||
vec![]
|
vec![Example {
|
||||||
|
description: "Panic with a custom message",
|
||||||
|
example: "panic 'This is a custom panic message'",
|
||||||
|
result: None,
|
||||||
|
}]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user