mirror of
https://github.com/nushell/nushell.git
synced 2025-06-30 22:50:14 +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
@ -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."
|
||||
}
|
||||
|
||||
|
@ -65,7 +65,7 @@ impl Command for ToCsv {
|
||||
]
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Convert table into .csv text ."
|
||||
}
|
||||
|
||||
|
@ -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."
|
||||
}
|
||||
|
||||
|
@ -27,7 +27,7 @@ impl Command for ToMd {
|
||||
.category(Category::Formats)
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Convert table into simple Markdown."
|
||||
}
|
||||
|
||||
|
@ -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.
|
||||
|
||||
|
@ -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)."
|
||||
}
|
||||
|
||||
|
@ -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."
|
||||
}
|
||||
|
||||
|
@ -24,7 +24,7 @@ impl Command for ToText {
|
||||
.category(Category::Formats)
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Converts data into simple text."
|
||||
}
|
||||
|
||||
|
@ -16,7 +16,7 @@ impl Command for ToToml {
|
||||
.category(Category::Formats)
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Convert record into .toml text."
|
||||
}
|
||||
|
||||
|
@ -34,7 +34,7 @@ impl Command for ToTsv {
|
||||
.category(Category::Formats)
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Convert table into .tsv text."
|
||||
}
|
||||
|
||||
|
@ -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."
|
||||
}
|
||||
|
||||
|
@ -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."
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user