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 Cd {
"cd"
}
fn usage(&self) -> &str {
fn description(&self) -> &str {
"Change directory."
}

View File

@ -27,7 +27,7 @@ impl Command for Du {
"du"
}
fn usage(&self) -> &str {
fn description(&self) -> &str {
"Find disk usage sizes of specified items."
}

View File

@ -44,7 +44,7 @@ impl Command for Glob {
.category(Category::FileSystem)
}
fn usage(&self) -> &str {
fn description(&self) -> &str {
"Creates a list of files and/or folders based on the glob pattern provided."
}
@ -114,7 +114,7 @@ impl Command for Glob {
]
}
fn extra_usage(&self) -> &str {
fn extra_description(&self) -> &str {
r#"For more glob pattern help, please refer to https://docs.rs/crate/wax/latest"#
}

View File

@ -38,7 +38,7 @@ impl Command for Ls {
"ls"
}
fn usage(&self) -> &str {
fn description(&self) -> &str {
"List the filenames, sizes, and modification times of items in a directory."
}

View File

@ -10,7 +10,7 @@ impl Command for Mktemp {
"mktemp"
}
fn usage(&self) -> &str {
fn description(&self) -> &str {
"Create temporary files or directories using uutils/coreutils mktemp."
}

View File

@ -18,11 +18,11 @@ impl Command for Open {
"open"
}
fn usage(&self) -> &str {
fn description(&self) -> &str {
"Load a file into a cell, converting to table if possible (avoid by appending '--raw')."
}
fn extra_usage(&self) -> &str {
fn extra_description(&self) -> &str {
"Support to automatically parse files with an extension `.xyz` can be provided by a `from xyz` command in scope."
}

View File

@ -25,7 +25,7 @@ impl Command for Rm {
"rm"
}
fn usage(&self) -> &str {
fn description(&self) -> &str {
"Remove files and directories."
}

View File

@ -22,7 +22,7 @@ impl Command for Save {
"save"
}
fn usage(&self) -> &str {
fn description(&self) -> &str {
"Save a file."
}

View File

@ -15,7 +15,7 @@ impl Command for Start {
"start"
}
fn usage(&self) -> &str {
fn description(&self) -> &str {
"Open a folder, file or website in the default application or viewer."
}

View File

@ -51,7 +51,7 @@ impl Command for Touch {
.category(Category::FileSystem)
}
fn usage(&self) -> &str {
fn description(&self) -> &str {
"Creates one or more files."
}

View File

@ -20,7 +20,7 @@ impl Command for UCp {
"cp"
}
fn usage(&self) -> &str {
fn description(&self) -> &str {
"Copy files using uutils/coreutils cp."
}

View File

@ -28,7 +28,7 @@ impl Command for UMkdir {
"mkdir"
}
fn usage(&self) -> &str {
fn description(&self) -> &str {
"Create directories, with intermediary directories if required using uutils/coreutils mkdir."
}

View File

@ -14,7 +14,7 @@ impl Command for UMv {
"mv"
}
fn usage(&self) -> &str {
fn description(&self) -> &str {
"Move files or directories using uutils/coreutils mv."
}

View File

@ -28,7 +28,7 @@ impl Command for Watch {
"watch"
}
fn usage(&self) -> &str {
fn description(&self) -> &str {
"Watch for file changes and execute Nu code when they happen."
}