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:
Stefan Holderbach
2024-08-22 12:02:08 +02:00
committed by GitHub
parent 3ab9f0b90a
commit 95b78eee25
597 changed files with 1085 additions and 1039 deletions

View File

@ -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."
}

View File

@ -8,7 +8,7 @@ impl Command for Debug {
"debug"
}
fn usage(&self) -> &str {
fn description(&self) -> &str {
"Debug print the value(s) piped in."
}

View File

@ -12,7 +12,7 @@ impl Command for Explain {
"explain"
}
fn usage(&self) -> &str {
fn description(&self) -> &str {
"Explain closure contents."
}

View File

@ -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."
}

View File

@ -10,7 +10,7 @@ impl Command for Inspect {
"inspect"
}
fn usage(&self) -> &str {
fn description(&self) -> &str {
"Inspect pipeline results while running a pipeline."
}

View File

@ -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."
}

View File

@ -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."
}

View File

@ -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.

View File

@ -9,7 +9,7 @@ impl Command for TimeIt {
"timeit"
}
fn usage(&self) -> &str {
fn description(&self) -> &str {
"Time the running time of a block."
}

View File

@ -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."
}

View File

@ -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."
}

View File

@ -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.

View File

@ -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."
}

View File

@ -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."
}