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

@ -15,11 +15,11 @@ impl Command for Complete {
.input_output_types(vec![(Type::Any, Type::record())])
}
fn usage(&self) -> &str {
fn description(&self) -> &str {
"Capture the outputs and exit code from an external piped in command in a nushell table."
}
fn extra_usage(&self) -> &str {
fn extra_description(&self) -> &str {
r#"In order to capture stdout, stderr, and exit_code, externally piped in commands need to be wrapped with `do`"#
}

View File

@ -16,11 +16,11 @@ impl Command for Exec {
.category(Category::System)
}
fn usage(&self) -> &str {
fn description(&self) -> &str {
"Execute a command, replacing or exiting the current process, depending on platform."
}
fn extra_usage(&self) -> &str {
fn extra_description(&self) -> &str {
r#"On Unix-based systems, the current process is replaced with the command.
On Windows based systems, Nushell will wait for the command to finish and then exit with the command's exit code."#
}

View File

@ -25,7 +25,7 @@ impl Command for NuCheck {
.category(Category::Strings)
}
fn usage(&self) -> &str {
fn description(&self) -> &str {
"Validate and parse input content."
}

View File

@ -26,7 +26,7 @@ impl Command for Ps {
.category(Category::System)
}
fn usage(&self) -> &str {
fn description(&self) -> &str {
"View information about system processes."
}

View File

@ -42,11 +42,11 @@ impl Command for RegistryQuery {
.category(Category::System)
}
fn usage(&self) -> &str {
fn description(&self) -> &str {
"Query the Windows registry."
}
fn extra_usage(&self) -> &str {
fn extra_description(&self) -> &str {
"Currently supported only on Windows systems."
}

View File

@ -23,7 +23,7 @@ impl Command for External {
"run-external"
}
fn usage(&self) -> &str {
fn description(&self) -> &str {
"Runs external command."
}

View File

@ -17,7 +17,7 @@ impl Command for SysCpu {
.input_output_types(vec![(Type::Nothing, Type::table())])
}
fn usage(&self) -> &str {
fn description(&self) -> &str {
"View information about the system CPUs."
}

View File

@ -17,7 +17,7 @@ impl Command for SysDisks {
.input_output_types(vec![(Type::Nothing, Type::table())])
}
fn usage(&self) -> &str {
fn description(&self) -> &str {
"View information about the system disks."
}

View File

@ -18,7 +18,7 @@ impl Command for SysHost {
.input_output_types(vec![(Type::Nothing, Type::record())])
}
fn usage(&self) -> &str {
fn description(&self) -> &str {
"View information about the system host."
}

View File

@ -16,7 +16,7 @@ impl Command for SysMem {
.input_output_types(vec![(Type::Nothing, Type::record())])
}
fn usage(&self) -> &str {
fn description(&self) -> &str {
"View information about the system memory."
}

View File

@ -17,7 +17,7 @@ impl Command for SysNet {
.input_output_types(vec![(Type::Nothing, Type::table())])
}
fn usage(&self) -> &str {
fn description(&self) -> &str {
"View information about the system network interfaces."
}

View File

@ -15,11 +15,11 @@ impl Command for Sys {
.input_output_types(vec![(Type::Nothing, Type::record())])
}
fn usage(&self) -> &str {
fn description(&self) -> &str {
"View information about the system."
}
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

@ -16,11 +16,11 @@ impl Command for SysTemp {
.input_output_types(vec![(Type::Nothing, Type::table())])
}
fn usage(&self) -> &str {
fn description(&self) -> &str {
"View the temperatures of system components."
}
fn extra_usage(&self) -> &str {
fn extra_description(&self) -> &str {
"Some system components do not support temperature readings, so this command may return an empty list if no components support temperature."
}

View File

@ -16,7 +16,7 @@ impl Command for SysUsers {
.input_output_types(vec![(Type::Nothing, Type::table())])
}
fn usage(&self) -> &str {
fn description(&self) -> &str {
"View information about the users on the system."
}

View File

@ -15,7 +15,7 @@ impl Command for UName {
.category(Category::System)
}
fn usage(&self) -> &str {
fn description(&self) -> &str {
"Print certain system information using uutils/coreutils uname."
}

View File

@ -20,7 +20,7 @@ impl Command for Which {
.category(Category::System)
}
fn usage(&self) -> &str {
fn description(&self) -> &str {
"Finds a program file, alias or custom command."
}