mirror of
https://github.com/nushell/nushell.git
synced 2025-08-12 07:29: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
@ -35,7 +35,7 @@ impl Command for SubCommand {
|
||||
.category(Category::Path)
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Get the final component of a path."
|
||||
}
|
||||
|
||||
|
@ -42,7 +42,7 @@ impl Command for SubCommand {
|
||||
.category(Category::Path)
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Get the parent directory of a path."
|
||||
}
|
||||
|
||||
|
@ -33,11 +33,11 @@ impl Command for SubCommand {
|
||||
.category(Category::Path)
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Check whether a path exists."
|
||||
}
|
||||
|
||||
fn extra_usage(&self) -> &str {
|
||||
fn extra_description(&self) -> &str {
|
||||
r#"This only checks if it is possible to either `open` or `cd` to the given path.
|
||||
If you need to distinguish dirs and files, please use `path type`."#
|
||||
}
|
||||
|
@ -42,7 +42,7 @@ impl Command for SubCommand {
|
||||
.category(Category::Path)
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Try to expand a path to its absolute form."
|
||||
}
|
||||
|
||||
|
@ -33,11 +33,11 @@ impl Command for SubCommand {
|
||||
.category(Category::Path)
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Join a structured path or a list of path parts."
|
||||
}
|
||||
|
||||
fn extra_usage(&self) -> &str {
|
||||
fn extra_description(&self) -> &str {
|
||||
r#"Optionally, append an additional path to the result. It is designed to accept
|
||||
the output of 'path parse' and 'path split' subcommands."#
|
||||
}
|
||||
|
@ -32,11 +32,11 @@ impl Command for SubCommand {
|
||||
.category(Category::Path)
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Convert a path into structured data."
|
||||
}
|
||||
|
||||
fn extra_usage(&self) -> &str {
|
||||
fn extra_description(&self) -> &str {
|
||||
r#"Each path is split into a table with 'parent', 'stem' and 'extension' fields.
|
||||
On Windows, an extra 'prefix' column is added."#
|
||||
}
|
||||
|
@ -14,11 +14,11 @@ impl Command for PathCommand {
|
||||
.category(Category::Path)
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Explore and manipulate paths."
|
||||
}
|
||||
|
||||
fn extra_usage(&self) -> &str {
|
||||
fn extra_description(&self) -> &str {
|
||||
r#"You must use one of the following subcommands. Using this command as-is will only produce this help message.
|
||||
|
||||
There are three ways to represent a path:
|
||||
|
@ -35,11 +35,11 @@ impl Command for SubCommand {
|
||||
.category(Category::Path)
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Express a path as relative to another path."
|
||||
}
|
||||
|
||||
fn extra_usage(&self) -> &str {
|
||||
fn extra_description(&self) -> &str {
|
||||
r#"Can be used only when the input and the argument paths are either both
|
||||
absolute or both relative. The argument path needs to be a parent of the input
|
||||
path."#
|
||||
|
@ -27,7 +27,7 @@ impl Command for SubCommand {
|
||||
.category(Category::Path)
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Split a path into a list based on the system's path separator."
|
||||
}
|
||||
|
||||
|
@ -31,11 +31,11 @@ impl Command for SubCommand {
|
||||
.category(Category::Path)
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Get the type of the object a path refers to (e.g., file, dir, symlink)."
|
||||
}
|
||||
|
||||
fn extra_usage(&self) -> &str {
|
||||
fn extra_description(&self) -> &str {
|
||||
r#"This checks the file system to confirm the path's object type.
|
||||
If the path does not exist, null will be returned."#
|
||||
}
|
||||
|
Reference in New Issue
Block a user