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

@ -8,7 +8,7 @@ impl Command for From {
"from"
}
fn usage(&self) -> &str {
fn description(&self) -> &str {
"Parse a string or binary data into structured data."
}
@ -18,7 +18,7 @@ impl Command for From {
.input_output_types(vec![(Type::Nothing, Type::String)])
}
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

@ -56,7 +56,7 @@ impl Command for FromCsv {
.category(Category::Formats)
}
fn usage(&self) -> &str {
fn description(&self) -> &str {
"Parse text as .csv and create table."
}

View File

@ -11,7 +11,7 @@ impl Command for FromJson {
"from json"
}
fn usage(&self) -> &str {
fn description(&self) -> &str {
"Convert from json to structured data."
}

View File

@ -31,11 +31,11 @@ impl Command for FromMsgpack {
.category(Category::Formats)
}
fn usage(&self) -> &str {
fn description(&self) -> &str {
"Convert MessagePack data into Nu values."
}
fn extra_usage(&self) -> &str {
fn extra_description(&self) -> &str {
r#"
Not all values are representable as MessagePack.

View File

@ -21,11 +21,11 @@ impl Command for FromMsgpackz {
.category(Category::Formats)
}
fn usage(&self) -> &str {
fn description(&self) -> &str {
"Convert brotli-compressed MessagePack data into Nu values."
}
fn extra_usage(&self) -> &str {
fn extra_description(&self) -> &str {
"This is the format used by the plugin registry file ($nu.plugin-path)."
}

View File

@ -8,7 +8,7 @@ impl Command for FromNuon {
"from nuon"
}
fn usage(&self) -> &str {
fn description(&self) -> &str {
"Convert from nuon to structured data."
}

View File

@ -25,7 +25,7 @@ impl Command for FromOds {
.category(Category::Formats)
}
fn usage(&self) -> &str {
fn description(&self) -> &str {
"Parse OpenDocument Spreadsheet(.ods) data and create table."
}

View File

@ -29,7 +29,7 @@ impl Command for FromSsv {
.category(Category::Formats)
}
fn usage(&self) -> &str {
fn description(&self) -> &str {
"Parse text as space-separated values and create a table. The default minimum number of spaces counted as a separator is 2."
}

View File

@ -15,7 +15,7 @@ impl Command for FromToml {
.category(Category::Formats)
}
fn usage(&self) -> &str {
fn description(&self) -> &str {
"Parse text as .toml and create record."
}

View File

@ -50,7 +50,7 @@ impl Command for FromTsv {
.category(Category::Formats)
}
fn usage(&self) -> &str {
fn description(&self) -> &str {
"Parse text as .tsv and create table."
}

View File

@ -26,7 +26,7 @@ impl Command for FromXlsx {
.category(Category::Formats)
}
fn usage(&self) -> &str {
fn description(&self) -> &str {
"Parse binary Excel(.xlsx) data and create table."
}

View File

@ -24,11 +24,11 @@ impl Command for FromXml {
.category(Category::Formats)
}
fn usage(&self) -> &str {
fn description(&self) -> &str {
"Parse text as .xml and create record."
}
fn extra_usage(&self) -> &str {
fn extra_description(&self) -> &str {
r#"Every XML entry is represented via a record with tag, attribute and content fields.
To represent different types of entries different values are written to this fields:
1. Tag entry: `{tag: <tag name> attrs: {<attr name>: "<string value>" ...} content: [<entries>]}`

View File

@ -17,7 +17,7 @@ impl Command for FromYaml {
.category(Category::Formats)
}
fn usage(&self) -> &str {
fn description(&self) -> &str {
"Parse text as .yaml/.yml and create table."
}
@ -51,7 +51,7 @@ impl Command for FromYml {
.category(Category::Formats)
}
fn usage(&self) -> &str {
fn description(&self) -> &str {
"Parse text as .yaml/.yml and create table."
}

View File

@ -8,7 +8,7 @@ impl Command for To {
"to"
}
fn usage(&self) -> &str {
fn description(&self) -> &str {
"Translate structured data to a format."
}
@ -18,7 +18,7 @@ impl Command for To {
.input_output_types(vec![(Type::Nothing, Type::String)])
}
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

@ -65,7 +65,7 @@ impl Command for ToCsv {
]
}
fn usage(&self) -> &str {
fn description(&self) -> &str {
"Convert table into .csv text ."
}

View File

@ -28,7 +28,7 @@ impl Command for ToJson {
.category(Category::Formats)
}
fn usage(&self) -> &str {
fn description(&self) -> &str {
"Converts table data into JSON text."
}

View File

@ -27,7 +27,7 @@ impl Command for ToMd {
.category(Category::Formats)
}
fn usage(&self) -> &str {
fn description(&self) -> &str {
"Convert table into simple Markdown."
}

View File

@ -25,11 +25,11 @@ impl Command for ToMsgpack {
.category(Category::Formats)
}
fn usage(&self) -> &str {
fn description(&self) -> &str {
"Convert Nu values into MessagePack."
}
fn extra_usage(&self) -> &str {
fn extra_description(&self) -> &str {
r#"
Not all values are representable as MessagePack.

View File

@ -34,11 +34,11 @@ impl Command for ToMsgpackz {
.category(Category::Formats)
}
fn usage(&self) -> &str {
fn description(&self) -> &str {
"Convert Nu values into brotli-compressed MessagePack."
}
fn extra_usage(&self) -> &str {
fn extra_description(&self) -> &str {
"This is the format used by the plugin registry file ($nu.plugin-path)."
}

View File

@ -31,7 +31,7 @@ impl Command for ToNuon {
.category(Category::Formats)
}
fn usage(&self) -> &str {
fn description(&self) -> &str {
"Converts table data into Nuon (Nushell Object Notation) text."
}

View File

@ -24,7 +24,7 @@ impl Command for ToText {
.category(Category::Formats)
}
fn usage(&self) -> &str {
fn description(&self) -> &str {
"Converts data into simple text."
}

View File

@ -16,7 +16,7 @@ impl Command for ToToml {
.category(Category::Formats)
}
fn usage(&self) -> &str {
fn description(&self) -> &str {
"Convert record into .toml text."
}

View File

@ -34,7 +34,7 @@ impl Command for ToTsv {
.category(Category::Formats)
}
fn usage(&self) -> &str {
fn description(&self) -> &str {
"Convert table into .tsv text."
}

View File

@ -38,7 +38,7 @@ impl Command for ToXml {
.category(Category::Formats)
}
fn extra_usage(&self) -> &str {
fn extra_description(&self) -> &str {
r#"Every XML entry is represented via a record with tag, attribute and content fields.
To represent different types of entries different values must be written to this fields:
1. Tag entry: `{tag: <tag name> attributes: {<attr name>: "<string value>" ...} content: [<entries>]}`
@ -89,7 +89,7 @@ Additionally any field which is: empty record, empty list or null, can be omitte
]
}
fn usage(&self) -> &str {
fn description(&self) -> &str {
"Convert special record structure into .xml text."
}

View File

@ -15,7 +15,7 @@ impl Command for ToYaml {
.category(Category::Formats)
}
fn usage(&self) -> &str {
fn description(&self) -> &str {
"Convert table into .yaml/.yml text."
}