mirror of
https://github.com/nushell/nushell.git
synced 2025-08-09 10:15:41 +02:00
Change the usage misnomer to "description" (#13598)
# Description The meaning of the word usage is specific to describing how a command function is *used* and not a synonym for general description. Usage can be used to describe the SYNOPSIS or EXAMPLES sections of a man page where the permitted argument combinations are shown or example *uses* are given. Let's not confuse people and call it what it is a description. Our `help` command already creates its own *Usage* section based on the available arguments and doesn't refer to the description with usage. # User-Facing Changes `help commands` and `scope commands` will now use `description` or `extra_description` `usage`-> `description` `extra_usage` -> `extra_description` Breaking change in the plugin protocol: In the signature record communicated with the engine. `usage`-> `description` `extra_usage` -> `extra_description` The same rename also takes place for the methods on `SimplePluginCommand` and `PluginCommand` # Tests + Formatting - Updated plugin protocol specific changes # After Submitting - [ ] update plugin protocol doc
This commit is contained in:
committed by
GitHub
parent
3ab9f0b90a
commit
95b78eee25
@ -10,7 +10,7 @@ impl Command for Ast {
|
||||
"ast"
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Print the abstract syntax tree (ast) for a pipeline."
|
||||
}
|
||||
|
||||
|
@ -8,7 +8,7 @@ impl Command for Debug {
|
||||
"debug"
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Debug print the value(s) piped in."
|
||||
}
|
||||
|
||||
|
@ -12,7 +12,7 @@ impl Command for Explain {
|
||||
"explain"
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Explain closure contents."
|
||||
}
|
||||
|
||||
|
@ -20,11 +20,11 @@ impl Command for DebugInfo {
|
||||
"debug info"
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"View process memory info."
|
||||
}
|
||||
|
||||
fn extra_usage(&self) -> &str {
|
||||
fn extra_description(&self) -> &str {
|
||||
"This command is meant for debugging purposes.\nIt shows you the process information and system memory information."
|
||||
}
|
||||
|
||||
|
@ -10,7 +10,7 @@ impl Command for Inspect {
|
||||
"inspect"
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Inspect pipeline results while running a pipeline."
|
||||
}
|
||||
|
||||
|
@ -12,7 +12,7 @@ impl Command for Metadata {
|
||||
"metadata"
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Get the metadata for items in the stream."
|
||||
}
|
||||
|
||||
|
@ -9,7 +9,7 @@ impl Command for MetadataSet {
|
||||
"metadata set"
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Set the metadata for items in the stream."
|
||||
}
|
||||
|
||||
|
@ -43,11 +43,11 @@ impl Command for DebugProfile {
|
||||
.category(Category::Debug)
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Profile pipeline elements in a closure."
|
||||
}
|
||||
|
||||
fn extra_usage(&self) -> &str {
|
||||
fn extra_description(&self) -> &str {
|
||||
r#"The profiler profiles every evaluated pipeline element inside a closure, stepping into all
|
||||
commands calls and other blocks/closures.
|
||||
|
||||
|
@ -9,7 +9,7 @@ impl Command for TimeIt {
|
||||
"timeit"
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Time the running time of a block."
|
||||
}
|
||||
|
||||
|
@ -14,11 +14,11 @@ impl Command for View {
|
||||
.input_output_types(vec![(Type::Nothing, Type::String)])
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Various commands for viewing debug information."
|
||||
}
|
||||
|
||||
fn extra_usage(&self) -> &str {
|
||||
fn extra_description(&self) -> &str {
|
||||
"You must use one of the following subcommands. Using this command as-is will only produce this help message."
|
||||
}
|
||||
|
||||
|
@ -8,11 +8,11 @@ impl Command for ViewFiles {
|
||||
"view files"
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"View the files registered in nushell's EngineState memory."
|
||||
}
|
||||
|
||||
fn extra_usage(&self) -> &str {
|
||||
fn extra_description(&self) -> &str {
|
||||
"These are files parsed and loaded at runtime."
|
||||
}
|
||||
|
||||
|
@ -29,11 +29,11 @@ impl Command for ViewIr {
|
||||
.category(Category::Debug)
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"View the compiled IR code for a block of code."
|
||||
}
|
||||
|
||||
fn extra_usage(&self) -> &str {
|
||||
fn extra_description(&self) -> &str {
|
||||
"
|
||||
The target can be a closure, the name of a custom command, or an internal block
|
||||
ID. Closure literals within IR dumps often reference the block by ID (e.g.
|
||||
|
@ -11,7 +11,7 @@ impl Command for ViewSource {
|
||||
"view source"
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"View a block, module, or a definition."
|
||||
}
|
||||
|
||||
|
@ -8,11 +8,11 @@ impl Command for ViewSpan {
|
||||
"view span"
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"View the contents of a span."
|
||||
}
|
||||
|
||||
fn extra_usage(&self) -> &str {
|
||||
fn extra_description(&self) -> &str {
|
||||
"This command is meant for debugging purposes.\nIt allows you to view the contents of nushell spans.\nOne way to get spans is to pipe something into 'debug --raw'.\nThen you can use the Span { start, end } values as the start and end values for this command."
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user