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
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
597 changed files with 1085 additions and 1039 deletions

View file

@ -14,7 +14,7 @@ impl Command for Commandline {
.category(Category::Core) .category(Category::Core)
} }
fn usage(&self) -> &str { fn description(&self) -> &str {
"View the current command line input buffer." "View the current command line input buffer."
} }

View file

@ -34,7 +34,7 @@ impl Command for SubCommand {
.category(Category::Core) .category(Category::Core)
} }
fn usage(&self) -> &str { fn description(&self) -> &str {
"Modify the current command line input buffer." "Modify the current command line input buffer."
} }

View file

@ -16,7 +16,7 @@ impl Command for SubCommand {
.category(Category::Core) .category(Category::Core)
} }
fn usage(&self) -> &str { fn description(&self) -> &str {
"Get the current cursor position." "Get the current cursor position."
} }

View file

@ -22,7 +22,7 @@ impl Command for SubCommand {
.category(Category::Core) .category(Category::Core)
} }
fn usage(&self) -> &str { fn description(&self) -> &str {
"Set the current cursor position." "Set the current cursor position."
} }

View file

@ -13,7 +13,7 @@ impl Command for History {
"history" "history"
} }
fn usage(&self) -> &str { fn description(&self) -> &str {
"Get the command history." "Get the command history."
} }

View file

@ -8,7 +8,7 @@ impl Command for HistorySession {
"history session" "history session"
} }
fn usage(&self) -> &str { fn description(&self) -> &str {
"Get the command history session." "Get the command history session."
} }

View file

@ -14,11 +14,11 @@ impl Command for Keybindings {
.input_output_types(vec![(Type::Nothing, Type::String)]) .input_output_types(vec![(Type::Nothing, Type::String)])
} }
fn usage(&self) -> &str { fn description(&self) -> &str {
"Keybindings related commands." "Keybindings related commands."
} }
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. r#"You must use one of the following subcommands. Using this command as-is will only produce this help message.
For more information on input and keybindings, check: For more information on input and keybindings, check:

View file

@ -15,7 +15,7 @@ impl Command for KeybindingsDefault {
.input_output_types(vec![(Type::Nothing, Type::table())]) .input_output_types(vec![(Type::Nothing, Type::table())])
} }
fn usage(&self) -> &str { fn description(&self) -> &str {
"List default keybindings." "List default keybindings."
} }

View file

@ -23,7 +23,7 @@ impl Command for KeybindingsList {
.category(Category::Platform) .category(Category::Platform)
} }
fn usage(&self) -> &str { fn description(&self) -> &str {
"List available options that can be used to create keybindings." "List available options that can be used to create keybindings."
} }

View file

@ -12,11 +12,11 @@ impl Command for KeybindingsListen {
"keybindings listen" "keybindings listen"
} }
fn usage(&self) -> &str { fn description(&self) -> &str {
"Get input from the user." "Get input from the user."
} }
fn extra_usage(&self) -> &str { fn extra_description(&self) -> &str {
"This is an internal debugging tool. For better output, try `input listen --types [key]`" "This is an internal debugging tool. For better output, try `input listen --types [key]`"
} }

View file

@ -30,12 +30,15 @@ impl NuHelpCompleter {
.filter_map(|(_, decl_id)| { .filter_map(|(_, decl_id)| {
let decl = self.engine_state.get_decl(decl_id); let decl = self.engine_state.get_decl(decl_id);
(decl.name().to_folded_case().contains(&folded_line) (decl.name().to_folded_case().contains(&folded_line)
|| decl.usage().to_folded_case().contains(&folded_line) || decl.description().to_folded_case().contains(&folded_line)
|| decl || decl
.search_terms() .search_terms()
.into_iter() .into_iter()
.any(|term| term.to_folded_case().contains(&folded_line)) .any(|term| term.to_folded_case().contains(&folded_line))
|| decl.extra_usage().to_folded_case().contains(&folded_line)) || decl
.extra_description()
.to_folded_case()
.contains(&folded_line))
.then_some(decl) .then_some(decl)
}) })
.collect::<Vec<_>>(); .collect::<Vec<_>>();
@ -47,15 +50,15 @@ impl NuHelpCompleter {
.map(|decl| { .map(|decl| {
let mut long_desc = String::new(); let mut long_desc = String::new();
let usage = decl.usage(); let description = decl.description();
if !usage.is_empty() { if !description.is_empty() {
long_desc.push_str(usage); long_desc.push_str(description);
long_desc.push_str("\r\n\r\n"); long_desc.push_str("\r\n\r\n");
} }
let extra_usage = decl.extra_usage(); let extra_desc = decl.extra_description();
if !extra_usage.is_empty() { if !extra_desc.is_empty() {
long_desc.push_str(extra_usage); long_desc.push_str(extra_desc);
long_desc.push_str("\r\n\r\n"); long_desc.push_str("\r\n\r\n");
} }

View file

@ -17,7 +17,7 @@ impl Command for NuHighlight {
.input_output_types(vec![(Type::String, Type::String)]) .input_output_types(vec![(Type::String, Type::String)])
} }
fn usage(&self) -> &str { fn description(&self) -> &str {
"Syntax highlight the input string." "Syntax highlight the input string."
} }

View file

@ -30,11 +30,11 @@ impl Command for Print {
.category(Category::Strings) .category(Category::Strings)
} }
fn usage(&self) -> &str { fn description(&self) -> &str {
"Print the given values to stdout." "Print the given values to stdout."
} }
fn extra_usage(&self) -> &str { fn extra_description(&self) -> &str {
r#"Unlike `echo`, this command does not return any value (`print | describe` will return "nothing"). r#"Unlike `echo`, this command does not return any value (`print | describe` will return "nothing").
Since this command has no output, there is no point in piping it with other commands. Since this command has no output, there is no point in piping it with other commands.

View file

@ -37,7 +37,7 @@ impl Command for BitsAnd {
.category(Category::Bits) .category(Category::Bits)
} }
fn usage(&self) -> &str { fn description(&self) -> &str {
"Performs bitwise and for ints or binary values." "Performs bitwise and for ints or binary values."
} }

View file

@ -14,11 +14,11 @@ impl Command for Bits {
.input_output_types(vec![(Type::Nothing, Type::String)]) .input_output_types(vec![(Type::Nothing, Type::String)])
} }
fn usage(&self) -> &str { fn description(&self) -> &str {
"Various commands for working with bits." "Various commands for working with bits."
} }
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." "You must use one of the following subcommands. Using this command as-is will only produce this help message."
} }

View file

@ -45,7 +45,7 @@ impl Command for BitsInto {
.category(Category::Conversions) .category(Category::Conversions)
} }
fn usage(&self) -> &str { fn description(&self) -> &str {
"Convert value to a binary primitive." "Convert value to a binary primitive."
} }

View file

@ -51,7 +51,7 @@ impl Command for BitsNot {
.category(Category::Bits) .category(Category::Bits)
} }
fn usage(&self) -> &str { fn description(&self) -> &str {
"Performs logical negation on each bit." "Performs logical negation on each bit."
} }

View file

@ -38,7 +38,7 @@ impl Command for BitsOr {
.category(Category::Bits) .category(Category::Bits)
} }
fn usage(&self) -> &str { fn description(&self) -> &str {
"Performs bitwise or for ints or binary values." "Performs bitwise or for ints or binary values."
} }

View file

@ -53,7 +53,7 @@ impl Command for BitsRol {
.category(Category::Bits) .category(Category::Bits)
} }
fn usage(&self) -> &str { fn description(&self) -> &str {
"Bitwise rotate left for ints or binary values." "Bitwise rotate left for ints or binary values."
} }

View file

@ -53,7 +53,7 @@ impl Command for BitsRor {
.category(Category::Bits) .category(Category::Bits)
} }
fn usage(&self) -> &str { fn description(&self) -> &str {
"Bitwise rotate right for ints or binary values." "Bitwise rotate right for ints or binary values."
} }

View file

@ -55,7 +55,7 @@ impl Command for BitsShl {
.category(Category::Bits) .category(Category::Bits)
} }
fn usage(&self) -> &str { fn description(&self) -> &str {
"Bitwise shift left for ints or binary values." "Bitwise shift left for ints or binary values."
} }

View file

@ -52,7 +52,7 @@ impl Command for BitsShr {
.category(Category::Bits) .category(Category::Bits)
} }
fn usage(&self) -> &str { fn description(&self) -> &str {
"Bitwise shift right for ints or binary values." "Bitwise shift right for ints or binary values."
} }

View file

@ -38,7 +38,7 @@ impl Command for BitsXor {
.category(Category::Bits) .category(Category::Bits)
} }
fn usage(&self) -> &str { fn description(&self) -> &str {
"Performs bitwise xor for ints or binary values." "Performs bitwise xor for ints or binary values."
} }

View file

@ -9,7 +9,7 @@ impl Command for Fmt {
"fmt" "fmt"
} }
fn usage(&self) -> &str { fn description(&self) -> &str {
"Format a number." "Format a number."
} }

View file

@ -9,7 +9,7 @@ impl Command for EachWhile {
"each while" "each while"
} }
fn usage(&self) -> &str { fn description(&self) -> &str {
"Run a closure on each row of the input list until a null is found, then create a new list with the results." "Run a closure on each row of the input list until a null is found, then create a new list with the results."
} }

View file

@ -18,11 +18,11 @@ impl Command for Roll {
.input_output_types(vec![(Type::Nothing, Type::String)]) .input_output_types(vec![(Type::Nothing, Type::String)])
} }
fn usage(&self) -> &str { fn description(&self) -> &str {
"Rolling commands for tables." "Rolling commands for tables."
} }
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." "You must use one of the following subcommands. Using this command as-is will only produce this help message."
} }

View file

@ -21,7 +21,7 @@ impl Command for RollDown {
.category(Category::Filters) .category(Category::Filters)
} }
fn usage(&self) -> &str { fn description(&self) -> &str {
"Roll table rows down." "Roll table rows down."
} }

View file

@ -33,7 +33,7 @@ impl Command for RollLeft {
.category(Category::Filters) .category(Category::Filters)
} }
fn usage(&self) -> &str { fn description(&self) -> &str {
"Roll record or table columns left." "Roll record or table columns left."
} }

View file

@ -33,7 +33,7 @@ impl Command for RollRight {
.category(Category::Filters) .category(Category::Filters)
} }
fn usage(&self) -> &str { fn description(&self) -> &str {
"Roll table columns right." "Roll table columns right."
} }

View file

@ -21,7 +21,7 @@ impl Command for RollUp {
.category(Category::Filters) .category(Category::Filters)
} }
fn usage(&self) -> &str { fn description(&self) -> &str {
"Roll table rows up." "Roll table rows up."
} }

View file

@ -23,7 +23,7 @@ impl Command for Rotate {
.category(Category::Filters) .category(Category::Filters)
} }
fn usage(&self) -> &str { fn description(&self) -> &str {
"Rotates a table or record clockwise (default) or counter-clockwise (use --ccw flag)." "Rotates a table or record clockwise (default) or counter-clockwise (use --ccw flag)."
} }

View file

@ -27,7 +27,7 @@ impl Command for UpdateCells {
.category(Category::Filters) .category(Category::Filters)
} }
fn usage(&self) -> &str { fn description(&self) -> &str {
"Update the table cells." "Update the table cells."
} }

View file

@ -14,7 +14,7 @@ impl Command for FromUrl {
.category(Category::Formats) .category(Category::Formats)
} }
fn usage(&self) -> &str { fn description(&self) -> &str {
"Parse url-encoded string as a record." "Parse url-encoded string as a record."
} }

View file

@ -138,11 +138,11 @@ impl Command for ToHtml {
] ]
} }
fn usage(&self) -> &str { fn description(&self) -> &str {
"Convert table into simple HTML." "Convert table into simple HTML."
} }
fn extra_usage(&self) -> &str { fn extra_description(&self) -> &str {
"Screenshots of the themes can be browsed here: https://github.com/mbadolato/iTerm2-Color-Schemes." "Screenshots of the themes can be browsed here: https://github.com/mbadolato/iTerm2-Color-Schemes."
} }

View file

@ -22,7 +22,7 @@ impl Command for SubCommand {
.category(Category::Math) .category(Category::Math)
} }
fn usage(&self) -> &str { fn description(&self) -> &str {
"Returns the arccosine of the number." "Returns the arccosine of the number."
} }

View file

@ -21,7 +21,7 @@ impl Command for SubCommand {
.category(Category::Math) .category(Category::Math)
} }
fn usage(&self) -> &str { fn description(&self) -> &str {
"Returns the inverse of the hyperbolic cosine function." "Returns the inverse of the hyperbolic cosine function."
} }

View file

@ -22,7 +22,7 @@ impl Command for SubCommand {
.category(Category::Math) .category(Category::Math)
} }
fn usage(&self) -> &str { fn description(&self) -> &str {
"Returns the arcsine of the number." "Returns the arcsine of the number."
} }

View file

@ -21,7 +21,7 @@ impl Command for SubCommand {
.category(Category::Math) .category(Category::Math)
} }
fn usage(&self) -> &str { fn description(&self) -> &str {
"Returns the inverse of the hyperbolic sine function." "Returns the inverse of the hyperbolic sine function."
} }

View file

@ -22,7 +22,7 @@ impl Command for SubCommand {
.category(Category::Math) .category(Category::Math)
} }
fn usage(&self) -> &str { fn description(&self) -> &str {
"Returns the arctangent of the number." "Returns the arctangent of the number."
} }

View file

@ -21,7 +21,7 @@ impl Command for SubCommand {
.category(Category::Math) .category(Category::Math)
} }
fn usage(&self) -> &str { fn description(&self) -> &str {
"Returns the inverse of the hyperbolic tangent function." "Returns the inverse of the hyperbolic tangent function."
} }

View file

@ -21,7 +21,7 @@ impl Command for SubCommand {
.category(Category::Math) .category(Category::Math)
} }
fn usage(&self) -> &str { fn description(&self) -> &str {
"Returns the cosine of the number." "Returns the cosine of the number."
} }

View file

@ -21,7 +21,7 @@ impl Command for SubCommand {
.category(Category::Math) .category(Category::Math)
} }
fn usage(&self) -> &str { fn description(&self) -> &str {
"Returns the hyperbolic cosine of the number." "Returns the hyperbolic cosine of the number."
} }

View file

@ -21,7 +21,7 @@ impl Command for SubCommand {
.category(Category::Math) .category(Category::Math)
} }
fn usage(&self) -> &str { fn description(&self) -> &str {
"Returns e raised to the power of x." "Returns e raised to the power of x."
} }

View file

@ -21,7 +21,7 @@ impl Command for SubCommand {
.category(Category::Math) .category(Category::Math)
} }
fn usage(&self) -> &str { fn description(&self) -> &str {
"Returns the natural logarithm. Base: (math e)." "Returns the natural logarithm. Base: (math e)."
} }

View file

@ -21,7 +21,7 @@ impl Command for SubCommand {
.category(Category::Math) .category(Category::Math)
} }
fn usage(&self) -> &str { fn description(&self) -> &str {
"Returns the sine of the number." "Returns the sine of the number."
} }

View file

@ -21,7 +21,7 @@ impl Command for SubCommand {
.category(Category::Math) .category(Category::Math)
} }
fn usage(&self) -> &str { fn description(&self) -> &str {
"Returns the hyperbolic sine of the number." "Returns the hyperbolic sine of the number."
} }

View file

@ -21,7 +21,7 @@ impl Command for SubCommand {
.category(Category::Math) .category(Category::Math)
} }
fn usage(&self) -> &str { fn description(&self) -> &str {
"Returns the tangent of the number." "Returns the tangent of the number."
} }

View file

@ -21,7 +21,7 @@ impl Command for SubCommand {
.category(Category::Math) .category(Category::Math)
} }
fn usage(&self) -> &str { fn description(&self) -> &str {
"Returns the hyperbolic tangent of the number." "Returns the hyperbolic tangent of the number."
} }

View file

@ -53,7 +53,7 @@ impl Command for SubCommand {
.category(Category::Platform) .category(Category::Platform)
} }
fn usage(&self) -> &str { fn description(&self) -> &str {
"Add a color gradient (using ANSI color codes) to the given string." "Add a color gradient (using ANSI color codes) to the given string."
} }

View file

@ -29,7 +29,7 @@ impl Command for DecodeHex {
.category(Category::Formats) .category(Category::Formats)
} }
fn usage(&self) -> &str { fn description(&self) -> &str {
"Hex decode a value." "Hex decode a value."
} }

View file

@ -29,7 +29,7 @@ impl Command for EncodeHex {
.category(Category::Formats) .category(Category::Formats)
} }
fn usage(&self) -> &str { fn description(&self) -> &str {
"Encode a binary value using hex." "Encode a binary value using hex."
} }

View file

@ -24,7 +24,7 @@ impl Command for FormatPattern {
.category(Category::Strings) .category(Category::Strings)
} }
fn usage(&self) -> &str { fn description(&self) -> &str {
"Format columns into a string using a simple pattern." "Format columns into a string using a simple pattern."
} }

View file

@ -30,7 +30,7 @@ impl Command for SubCommand {
.category(Category::Strings) .category(Category::Strings)
} }
fn usage(&self) -> &str { fn description(&self) -> &str {
"Convert a string to camelCase." "Convert a string to camelCase."
} }

View file

@ -30,7 +30,7 @@ impl Command for SubCommand {
.category(Category::Strings) .category(Category::Strings)
} }
fn usage(&self) -> &str { fn description(&self) -> &str {
"Convert a string to kebab-case." "Convert a string to kebab-case."
} }

View file

@ -30,7 +30,7 @@ impl Command for SubCommand {
.category(Category::Strings) .category(Category::Strings)
} }
fn usage(&self) -> &str { fn description(&self) -> &str {
"Convert a string to PascalCase." "Convert a string to PascalCase."
} }

View file

@ -30,7 +30,7 @@ impl Command for SubCommand {
.category(Category::Strings) .category(Category::Strings)
} }
fn usage(&self) -> &str { fn description(&self) -> &str {
"Convert a string to SCREAMING_SNAKE_CASE." "Convert a string to SCREAMING_SNAKE_CASE."
} }

View file

@ -30,7 +30,7 @@ impl Command for SubCommand {
.category(Category::Strings) .category(Category::Strings)
} }
fn usage(&self) -> &str { fn description(&self) -> &str {
"Convert a string to snake_case." "Convert a string to snake_case."
} }

View file

@ -14,11 +14,11 @@ impl Command for Str {
.input_output_types(vec![(Type::Nothing, Type::String)]) .input_output_types(vec![(Type::Nothing, Type::String)])
} }
fn usage(&self) -> &str { fn description(&self) -> &str {
"Various commands for working with string data." "Various commands for working with string data."
} }
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." "You must use one of the following subcommands. Using this command as-is will only produce this help message."
} }

View file

@ -30,7 +30,7 @@ impl Command for SubCommand {
.category(Category::Strings) .category(Category::Strings)
} }
fn usage(&self) -> &str { fn description(&self) -> &str {
"Convert a string to Title Case." "Convert a string to Title Case."
} }

View file

@ -9,7 +9,7 @@ impl Command for Alias {
"alias" "alias"
} }
fn usage(&self) -> &str { fn description(&self) -> &str {
"Alias a command (with optional flags) to a new name." "Alias a command (with optional flags) to a new name."
} }
@ -25,7 +25,7 @@ impl Command for Alias {
.category(Category::Core) .category(Category::Core)
} }
fn extra_usage(&self) -> &str { fn extra_description(&self) -> &str {
r#"This command is a parser keyword. For details, check: r#"This command is a parser keyword. For details, check:
https://www.nushell.sh/book/thinking_in_nu.html"# https://www.nushell.sh/book/thinking_in_nu.html"#
} }

View file

@ -9,7 +9,7 @@ impl Command for Break {
"break" "break"
} }
fn usage(&self) -> &str { fn description(&self) -> &str {
"Break a loop." "Break a loop."
} }
@ -19,7 +19,7 @@ impl Command for Break {
.category(Category::Core) .category(Category::Core)
} }
fn extra_usage(&self) -> &str { fn extra_description(&self) -> &str {
r#"This command is a parser keyword. For details, check: r#"This command is a parser keyword. For details, check:
https://www.nushell.sh/book/thinking_in_nu.html https://www.nushell.sh/book/thinking_in_nu.html

View file

@ -25,11 +25,11 @@ impl Command for Collect {
.category(Category::Filters) .category(Category::Filters)
} }
fn usage(&self) -> &str { fn description(&self) -> &str {
"Collect a stream into a value." "Collect a stream into a value."
} }
fn extra_usage(&self) -> &str { fn extra_description(&self) -> &str {
r#"If provided, run a closure with the collected value as input. r#"If provided, run a closure with the collected value as input.
The entire stream will be collected into one value in memory, so if the stream The entire stream will be collected into one value in memory, so if the stream

View file

@ -9,7 +9,7 @@ impl Command for Const {
"const" "const"
} }
fn usage(&self) -> &str { fn description(&self) -> &str {
"Create a parse-time constant." "Create a parse-time constant."
} }
@ -26,7 +26,7 @@ impl Command for Const {
.category(Category::Core) .category(Category::Core)
} }
fn extra_usage(&self) -> &str { fn extra_description(&self) -> &str {
r#"This command is a parser keyword. For details, check: r#"This command is a parser keyword. For details, check:
https://www.nushell.sh/book/thinking_in_nu.html"# https://www.nushell.sh/book/thinking_in_nu.html"#
} }

View file

@ -9,7 +9,7 @@ impl Command for Continue {
"continue" "continue"
} }
fn usage(&self) -> &str { fn description(&self) -> &str {
"Continue a loop from the next iteration." "Continue a loop from the next iteration."
} }
@ -19,7 +19,7 @@ impl Command for Continue {
.category(Category::Core) .category(Category::Core)
} }
fn extra_usage(&self) -> &str { fn extra_description(&self) -> &str {
r#"This command is a parser keyword. For details, check: r#"This command is a parser keyword. For details, check:
https://www.nushell.sh/book/thinking_in_nu.html https://www.nushell.sh/book/thinking_in_nu.html

View file

@ -9,7 +9,7 @@ impl Command for Def {
"def" "def"
} }
fn usage(&self) -> &str { fn description(&self) -> &str {
"Define a custom command." "Define a custom command."
} }
@ -24,7 +24,7 @@ impl Command for Def {
.category(Category::Core) .category(Category::Core)
} }
fn extra_usage(&self) -> &str { fn extra_description(&self) -> &str {
r#"This command is a parser keyword. For details, check: r#"This command is a parser keyword. For details, check:
https://www.nushell.sh/book/thinking_in_nu.html"# https://www.nushell.sh/book/thinking_in_nu.html"#
} }

View file

@ -9,7 +9,7 @@ impl Command for Describe {
"describe" "describe"
} }
fn usage(&self) -> &str { fn description(&self) -> &str {
"Describe the type and structure of the value(s) piped in." "Describe the type and structure of the value(s) piped in."
} }

View file

@ -17,7 +17,7 @@ impl Command for Do {
"do" "do"
} }
fn usage(&self) -> &str { fn description(&self) -> &str {
"Run a closure, providing it with the pipeline input." "Run a closure, providing it with the pipeline input."
} }

View file

@ -8,7 +8,7 @@ impl Command for Echo {
"echo" "echo"
} }
fn usage(&self) -> &str { fn description(&self) -> &str {
"Returns its arguments, ignoring the piped-in value." "Returns its arguments, ignoring the piped-in value."
} }
@ -19,7 +19,7 @@ impl Command for Echo {
.category(Category::Core) .category(Category::Core)
} }
fn extra_usage(&self) -> &str { fn extra_description(&self) -> &str {
r#"Unlike `print`, which prints unstructured text to stdout, `echo` is like an r#"Unlike `print`, which prints unstructured text to stdout, `echo` is like an
identity function and simply returns its arguments. When given no arguments, identity function and simply returns its arguments. When given no arguments,
it returns an empty string. When given one argument, it returns it as a it returns an empty string. When given one argument, it returns it as a

View file

@ -25,7 +25,7 @@ impl Command for ErrorMake {
.category(Category::Core) .category(Category::Core)
} }
fn usage(&self) -> &str { fn description(&self) -> &str {
"Create an error." "Create an error."
} }

View file

@ -15,11 +15,11 @@ impl Command for ExportCommand {
.category(Category::Core) .category(Category::Core)
} }
fn usage(&self) -> &str { fn description(&self) -> &str {
"Export definitions or environment variables from a module." "Export definitions or environment variables from a module."
} }
fn extra_usage(&self) -> &str { fn extra_description(&self) -> &str {
r#"This command is a parser keyword. For details, check: r#"This command is a parser keyword. For details, check:
https://www.nushell.sh/book/thinking_in_nu.html"# https://www.nushell.sh/book/thinking_in_nu.html"#
} }

View file

@ -9,7 +9,7 @@ impl Command for ExportAlias {
"export alias" "export alias"
} }
fn usage(&self) -> &str { fn description(&self) -> &str {
"Alias a command (with optional flags) to a new name and export it from a module." "Alias a command (with optional flags) to a new name and export it from a module."
} }
@ -25,7 +25,7 @@ impl Command for ExportAlias {
.category(Category::Core) .category(Category::Core)
} }
fn extra_usage(&self) -> &str { fn extra_description(&self) -> &str {
r#"This command is a parser keyword. For details, check: r#"This command is a parser keyword. For details, check:
https://www.nushell.sh/book/thinking_in_nu.html"# https://www.nushell.sh/book/thinking_in_nu.html"#
} }

View file

@ -9,7 +9,7 @@ impl Command for ExportConst {
"export const" "export const"
} }
fn usage(&self) -> &str { fn description(&self) -> &str {
"Use parse-time constant from a module and export them from this module." "Use parse-time constant from a module and export them from this module."
} }
@ -26,7 +26,7 @@ impl Command for ExportConst {
.category(Category::Core) .category(Category::Core)
} }
fn extra_usage(&self) -> &str { fn extra_description(&self) -> &str {
r#"This command is a parser keyword. For details, check: r#"This command is a parser keyword. For details, check:
https://www.nushell.sh/book/thinking_in_nu.html"# https://www.nushell.sh/book/thinking_in_nu.html"#
} }

View file

@ -9,7 +9,7 @@ impl Command for ExportDef {
"export def" "export def"
} }
fn usage(&self) -> &str { fn description(&self) -> &str {
"Define a custom command and export it from a module." "Define a custom command and export it from a module."
} }
@ -24,7 +24,7 @@ impl Command for ExportDef {
.category(Category::Core) .category(Category::Core)
} }
fn extra_usage(&self) -> &str { fn extra_description(&self) -> &str {
r#"This command is a parser keyword. For details, check: r#"This command is a parser keyword. For details, check:
https://www.nushell.sh/book/thinking_in_nu.html"# https://www.nushell.sh/book/thinking_in_nu.html"#
} }

View file

@ -9,7 +9,7 @@ impl Command for ExportExtern {
"export extern" "export extern"
} }
fn usage(&self) -> &str { fn description(&self) -> &str {
"Define an extern and export it from a module." "Define an extern and export it from a module."
} }
@ -21,7 +21,7 @@ impl Command for ExportExtern {
.category(Category::Core) .category(Category::Core)
} }
fn extra_usage(&self) -> &str { fn extra_description(&self) -> &str {
r#"This command is a parser keyword. For details, check: r#"This command is a parser keyword. For details, check:
https://www.nushell.sh/book/thinking_in_nu.html"# https://www.nushell.sh/book/thinking_in_nu.html"#
} }

View file

@ -9,7 +9,7 @@ impl Command for ExportModule {
"export module" "export module"
} }
fn usage(&self) -> &str { fn description(&self) -> &str {
"Export a custom module from a module." "Export a custom module from a module."
} }
@ -26,7 +26,7 @@ impl Command for ExportModule {
.category(Category::Core) .category(Category::Core)
} }
fn extra_usage(&self) -> &str { fn extra_description(&self) -> &str {
r#"This command is a parser keyword. For details, check: r#"This command is a parser keyword. For details, check:
https://www.nushell.sh/book/thinking_in_nu.html"# https://www.nushell.sh/book/thinking_in_nu.html"#
} }

View file

@ -9,7 +9,7 @@ impl Command for ExportUse {
"export use" "export use"
} }
fn usage(&self) -> &str { fn description(&self) -> &str {
"Use definitions from a module and export them from this module." "Use definitions from a module and export them from this module."
} }
@ -25,7 +25,7 @@ impl Command for ExportUse {
.category(Category::Core) .category(Category::Core)
} }
fn extra_usage(&self) -> &str { fn extra_description(&self) -> &str {
r#"This command is a parser keyword. For details, check: r#"This command is a parser keyword. For details, check:
https://www.nushell.sh/book/thinking_in_nu.html"# https://www.nushell.sh/book/thinking_in_nu.html"#
} }

View file

@ -9,7 +9,7 @@ impl Command for Extern {
"extern" "extern"
} }
fn usage(&self) -> &str { fn description(&self) -> &str {
"Define a signature for an external command." "Define a signature for an external command."
} }
@ -21,7 +21,7 @@ impl Command for Extern {
.category(Category::Core) .category(Category::Core)
} }
fn extra_usage(&self) -> &str { fn extra_description(&self) -> &str {
r#"This command is a parser keyword. For details, check: r#"This command is a parser keyword. For details, check:
https://www.nushell.sh/book/thinking_in_nu.html"# https://www.nushell.sh/book/thinking_in_nu.html"#
} }

View file

@ -9,7 +9,7 @@ impl Command for For {
"for" "for"
} }
fn usage(&self) -> &str { fn description(&self) -> &str {
"Loop over a range." "Loop over a range."
} }
@ -32,7 +32,7 @@ impl Command for For {
.category(Category::Core) .category(Category::Core)
} }
fn extra_usage(&self) -> &str { fn extra_description(&self) -> &str {
r#"This command is a parser keyword. For details, check: r#"This command is a parser keyword. For details, check:
https://www.nushell.sh/book/thinking_in_nu.html"# https://www.nushell.sh/book/thinking_in_nu.html"#
} }

View file

@ -21,11 +21,11 @@ impl Command for Hide {
.category(Category::Core) .category(Category::Core)
} }
fn usage(&self) -> &str { fn description(&self) -> &str {
"Hide definitions in the current scope." "Hide definitions in the current scope."
} }
fn extra_usage(&self) -> &str { fn extra_description(&self) -> &str {
r#"Definitions are hidden by priority: First aliases, then custom commands. r#"Definitions are hidden by priority: First aliases, then custom commands.
This command is a parser keyword. For details, check: This command is a parser keyword. For details, check:

View file

@ -25,7 +25,7 @@ impl Command for HideEnv {
.category(Category::Core) .category(Category::Core)
} }
fn usage(&self) -> &str { fn description(&self) -> &str {
"Hide environment variables in the current scope." "Hide environment variables in the current scope."
} }

View file

@ -14,7 +14,7 @@ impl Command for If {
"if" "if"
} }
fn usage(&self) -> &str { fn description(&self) -> &str {
"Conditionally run a block." "Conditionally run a block."
} }
@ -41,7 +41,7 @@ impl Command for If {
.category(Category::Core) .category(Category::Core)
} }
fn extra_usage(&self) -> &str { fn extra_description(&self) -> &str {
r#"This command is a parser keyword. For details, check: r#"This command is a parser keyword. For details, check:
https://www.nushell.sh/book/thinking_in_nu.html"# https://www.nushell.sh/book/thinking_in_nu.html"#
} }

View file

@ -9,7 +9,7 @@ impl Command for Ignore {
"ignore" "ignore"
} }
fn usage(&self) -> &str { fn description(&self) -> &str {
"Ignore the output of the previous command in the pipeline." "Ignore the output of the previous command in the pipeline."
} }

View file

@ -9,7 +9,7 @@ impl Command for Let {
"let" "let"
} }
fn usage(&self) -> &str { fn description(&self) -> &str {
"Create a variable and give it a value." "Create a variable and give it a value."
} }
@ -26,7 +26,7 @@ impl Command for Let {
.category(Category::Core) .category(Category::Core)
} }
fn extra_usage(&self) -> &str { fn extra_description(&self) -> &str {
r#"This command is a parser keyword. For details, check: r#"This command is a parser keyword. For details, check:
https://www.nushell.sh/book/thinking_in_nu.html"# https://www.nushell.sh/book/thinking_in_nu.html"#
} }

View file

@ -9,7 +9,7 @@ impl Command for Loop {
"loop" "loop"
} }
fn usage(&self) -> &str { fn description(&self) -> &str {
"Run a block in a loop." "Run a block in a loop."
} }
@ -21,7 +21,7 @@ impl Command for Loop {
.category(Category::Core) .category(Category::Core)
} }
fn extra_usage(&self) -> &str { fn extra_description(&self) -> &str {
r#"This command is a parser keyword. For details, check: r#"This command is a parser keyword. For details, check:
https://www.nushell.sh/book/thinking_in_nu.html"# https://www.nushell.sh/book/thinking_in_nu.html"#
} }

View file

@ -11,7 +11,7 @@ impl Command for Match {
"match" "match"
} }
fn usage(&self) -> &str { fn description(&self) -> &str {
"Conditionally run a block on a matched value." "Conditionally run a block on a matched value."
} }
@ -27,7 +27,7 @@ impl Command for Match {
.category(Category::Core) .category(Category::Core)
} }
fn extra_usage(&self) -> &str { fn extra_description(&self) -> &str {
r#"This command is a parser keyword. For details, check: r#"This command is a parser keyword. For details, check:
https://www.nushell.sh/book/thinking_in_nu.html"# https://www.nushell.sh/book/thinking_in_nu.html"#
} }

View file

@ -9,7 +9,7 @@ impl Command for Module {
"module" "module"
} }
fn usage(&self) -> &str { fn description(&self) -> &str {
"Define a custom module." "Define a custom module."
} }
@ -26,7 +26,7 @@ impl Command for Module {
.category(Category::Core) .category(Category::Core)
} }
fn extra_usage(&self) -> &str { fn extra_description(&self) -> &str {
r#"This command is a parser keyword. For details, check: r#"This command is a parser keyword. For details, check:
https://www.nushell.sh/book/thinking_in_nu.html"# https://www.nushell.sh/book/thinking_in_nu.html"#
} }

View file

@ -9,7 +9,7 @@ impl Command for Mut {
"mut" "mut"
} }
fn usage(&self) -> &str { fn description(&self) -> &str {
"Create a mutable variable and give it a value." "Create a mutable variable and give it a value."
} }
@ -26,7 +26,7 @@ impl Command for Mut {
.category(Category::Core) .category(Category::Core)
} }
fn extra_usage(&self) -> &str { fn extra_description(&self) -> &str {
r#"This command is a parser keyword. For details, check: r#"This command is a parser keyword. For details, check:
https://www.nushell.sh/book/thinking_in_nu.html"# https://www.nushell.sh/book/thinking_in_nu.html"#
} }

View file

@ -15,11 +15,11 @@ impl Command for Overlay {
.input_output_types(vec![(Type::Nothing, Type::String)]) .input_output_types(vec![(Type::Nothing, Type::String)])
} }
fn usage(&self) -> &str { fn description(&self) -> &str {
"Commands for manipulating overlays." "Commands for manipulating overlays."
} }
fn extra_usage(&self) -> &str { fn extra_description(&self) -> &str {
r#"This command is a parser keyword. For details, check: r#"This command is a parser keyword. For details, check:
https://www.nushell.sh/book/thinking_in_nu.html https://www.nushell.sh/book/thinking_in_nu.html

View file

@ -9,7 +9,7 @@ impl Command for OverlayHide {
"overlay hide" "overlay hide"
} }
fn usage(&self) -> &str { fn description(&self) -> &str {
"Hide an active overlay." "Hide an active overlay."
} }
@ -31,7 +31,7 @@ impl Command for OverlayHide {
.category(Category::Core) .category(Category::Core)
} }
fn extra_usage(&self) -> &str { fn extra_description(&self) -> &str {
r#"This command is a parser keyword. For details, check: r#"This command is a parser keyword. For details, check:
https://www.nushell.sh/book/thinking_in_nu.html"# https://www.nushell.sh/book/thinking_in_nu.html"#
} }

View file

@ -8,7 +8,7 @@ impl Command for OverlayList {
"overlay list" "overlay list"
} }
fn usage(&self) -> &str { fn description(&self) -> &str {
"List all active overlays." "List all active overlays."
} }
@ -18,7 +18,7 @@ impl Command for OverlayList {
.input_output_types(vec![(Type::Nothing, Type::List(Box::new(Type::String)))]) .input_output_types(vec![(Type::Nothing, Type::List(Box::new(Type::String)))])
} }
fn extra_usage(&self) -> &str { fn extra_description(&self) -> &str {
"The overlays are listed in the order they were activated." "The overlays are listed in the order they were activated."
} }

View file

@ -9,7 +9,7 @@ impl Command for OverlayNew {
"overlay new" "overlay new"
} }
fn usage(&self) -> &str { fn description(&self) -> &str {
"Create an empty overlay." "Create an empty overlay."
} }
@ -27,7 +27,7 @@ impl Command for OverlayNew {
.category(Category::Core) .category(Category::Core)
} }
fn extra_usage(&self) -> &str { fn extra_description(&self) -> &str {
r#"The command will first create an empty module, then add it as an overlay. r#"The command will first create an empty module, then add it as an overlay.
This command is a parser keyword. For details, check: This command is a parser keyword. For details, check:

View file

@ -14,7 +14,7 @@ impl Command for OverlayUse {
"overlay use" "overlay use"
} }
fn usage(&self) -> &str { fn description(&self) -> &str {
"Use definitions from a module as an overlay." "Use definitions from a module as an overlay."
} }
@ -45,7 +45,7 @@ impl Command for OverlayUse {
.category(Category::Core) .category(Category::Core)
} }
fn extra_usage(&self) -> &str { fn extra_description(&self) -> &str {
r#"This command is a parser keyword. For details, check: r#"This command is a parser keyword. For details, check:
https://www.nushell.sh/book/thinking_in_nu.html"# https://www.nushell.sh/book/thinking_in_nu.html"#
} }

View file

@ -9,7 +9,7 @@ impl Command for Return {
"return" "return"
} }
fn usage(&self) -> &str { fn description(&self) -> &str {
"Return early from a function." "Return early from a function."
} }
@ -24,7 +24,7 @@ impl Command for Return {
.category(Category::Core) .category(Category::Core)
} }
fn extra_usage(&self) -> &str { fn extra_description(&self) -> &str {
r#"This command is a parser keyword. For details, check: r#"This command is a parser keyword. For details, check:
https://www.nushell.sh/book/thinking_in_nu.html"# https://www.nushell.sh/book/thinking_in_nu.html"#
} }

View file

@ -15,7 +15,7 @@ impl Command for ScopeAliases {
.category(Category::Core) .category(Category::Core)
} }
fn usage(&self) -> &str { fn description(&self) -> &str {
"Output info on the aliases in the current scope." "Output info on the aliases in the current scope."
} }

View file

@ -15,7 +15,7 @@ impl Command for Scope {
.allow_variants_without_examples(true) .allow_variants_without_examples(true)
} }
fn usage(&self) -> &str { fn description(&self) -> &str {
"Commands for getting info about what is in scope." "Commands for getting info about what is in scope."
} }

View file

@ -15,7 +15,7 @@ impl Command for ScopeCommands {
.category(Category::Core) .category(Category::Core)
} }
fn usage(&self) -> &str { fn description(&self) -> &str {
"Output info on the commands in the current scope." "Output info on the commands in the current scope."
} }

View file

@ -15,7 +15,7 @@ impl Command for ScopeEngineStats {
.category(Category::Core) .category(Category::Core)
} }
fn usage(&self) -> &str { fn description(&self) -> &str {
"Output stats on the engine in the current state." "Output stats on the engine in the current state."
} }

View file

@ -15,7 +15,7 @@ impl Command for ScopeExterns {
.category(Category::Core) .category(Category::Core)
} }
fn usage(&self) -> &str { fn description(&self) -> &str {
"Output info on the known externals in the current scope." "Output info on the known externals in the current scope."
} }

View file

@ -15,7 +15,7 @@ impl Command for ScopeModules {
.category(Category::Core) .category(Category::Core)
} }
fn usage(&self) -> &str { fn description(&self) -> &str {
"Output info on the modules in the current scope." "Output info on the modules in the current scope."
} }

View file

@ -15,7 +15,7 @@ impl Command for ScopeVariables {
.category(Category::Core) .category(Category::Core)
} }
fn usage(&self) -> &str { fn description(&self) -> &str {
"Output info on the variables in the current scope." "Output info on the variables in the current scope."
} }

Some files were not shown because too many files have changed in this diff Show more