mirror of
https://github.com/nushell/nushell
synced 2024-11-10 07:04:13 +00: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:
parent
3ab9f0b90a
commit
95b78eee25
597 changed files with 1085 additions and 1039 deletions
|
@ -14,7 +14,7 @@ impl Command for Commandline {
|
|||
.category(Category::Core)
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"View the current command line input buffer."
|
||||
}
|
||||
|
||||
|
|
|
@ -34,7 +34,7 @@ impl Command for SubCommand {
|
|||
.category(Category::Core)
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Modify the current command line input buffer."
|
||||
}
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@ impl Command for SubCommand {
|
|||
.category(Category::Core)
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Get the current cursor position."
|
||||
}
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@ impl Command for SubCommand {
|
|||
.category(Category::Core)
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Set the current cursor position."
|
||||
}
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@ impl Command for History {
|
|||
"history"
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Get the command history."
|
||||
}
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@ impl Command for HistorySession {
|
|||
"history session"
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Get the command history session."
|
||||
}
|
||||
|
||||
|
|
|
@ -14,11 +14,11 @@ impl Command for Keybindings {
|
|||
.input_output_types(vec![(Type::Nothing, Type::String)])
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"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.
|
||||
|
||||
For more information on input and keybindings, check:
|
||||
|
|
|
@ -15,7 +15,7 @@ impl Command for KeybindingsDefault {
|
|||
.input_output_types(vec![(Type::Nothing, Type::table())])
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"List default keybindings."
|
||||
}
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@ impl Command for KeybindingsList {
|
|||
.category(Category::Platform)
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"List available options that can be used to create keybindings."
|
||||
}
|
||||
|
||||
|
|
|
@ -12,11 +12,11 @@ impl Command for KeybindingsListen {
|
|||
"keybindings listen"
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"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]`"
|
||||
}
|
||||
|
||||
|
|
|
@ -30,12 +30,15 @@ impl NuHelpCompleter {
|
|||
.filter_map(|(_, decl_id)| {
|
||||
let decl = self.engine_state.get_decl(decl_id);
|
||||
(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
|
||||
.search_terms()
|
||||
.into_iter()
|
||||
.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)
|
||||
})
|
||||
.collect::<Vec<_>>();
|
||||
|
@ -47,15 +50,15 @@ impl NuHelpCompleter {
|
|||
.map(|decl| {
|
||||
let mut long_desc = String::new();
|
||||
|
||||
let usage = decl.usage();
|
||||
if !usage.is_empty() {
|
||||
long_desc.push_str(usage);
|
||||
let description = decl.description();
|
||||
if !description.is_empty() {
|
||||
long_desc.push_str(description);
|
||||
long_desc.push_str("\r\n\r\n");
|
||||
}
|
||||
|
||||
let extra_usage = decl.extra_usage();
|
||||
if !extra_usage.is_empty() {
|
||||
long_desc.push_str(extra_usage);
|
||||
let extra_desc = decl.extra_description();
|
||||
if !extra_desc.is_empty() {
|
||||
long_desc.push_str(extra_desc);
|
||||
long_desc.push_str("\r\n\r\n");
|
||||
}
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@ impl Command for NuHighlight {
|
|||
.input_output_types(vec![(Type::String, Type::String)])
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Syntax highlight the input string."
|
||||
}
|
||||
|
||||
|
|
|
@ -30,11 +30,11 @@ impl Command for Print {
|
|||
.category(Category::Strings)
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"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").
|
||||
Since this command has no output, there is no point in piping it with other commands.
|
||||
|
||||
|
|
|
@ -37,7 +37,7 @@ impl Command for BitsAnd {
|
|||
.category(Category::Bits)
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Performs bitwise and for ints or binary values."
|
||||
}
|
||||
|
||||
|
|
|
@ -14,11 +14,11 @@ impl Command for Bits {
|
|||
.input_output_types(vec![(Type::Nothing, Type::String)])
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"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."
|
||||
}
|
||||
|
||||
|
|
|
@ -45,7 +45,7 @@ impl Command for BitsInto {
|
|||
.category(Category::Conversions)
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Convert value to a binary primitive."
|
||||
}
|
||||
|
||||
|
|
|
@ -51,7 +51,7 @@ impl Command for BitsNot {
|
|||
.category(Category::Bits)
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Performs logical negation on each bit."
|
||||
}
|
||||
|
||||
|
|
|
@ -38,7 +38,7 @@ impl Command for BitsOr {
|
|||
.category(Category::Bits)
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Performs bitwise or for ints or binary values."
|
||||
}
|
||||
|
||||
|
|
|
@ -53,7 +53,7 @@ impl Command for BitsRol {
|
|||
.category(Category::Bits)
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Bitwise rotate left for ints or binary values."
|
||||
}
|
||||
|
||||
|
|
|
@ -53,7 +53,7 @@ impl Command for BitsRor {
|
|||
.category(Category::Bits)
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Bitwise rotate right for ints or binary values."
|
||||
}
|
||||
|
||||
|
|
|
@ -55,7 +55,7 @@ impl Command for BitsShl {
|
|||
.category(Category::Bits)
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Bitwise shift left for ints or binary values."
|
||||
}
|
||||
|
||||
|
|
|
@ -52,7 +52,7 @@ impl Command for BitsShr {
|
|||
.category(Category::Bits)
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Bitwise shift right for ints or binary values."
|
||||
}
|
||||
|
||||
|
|
|
@ -38,7 +38,7 @@ impl Command for BitsXor {
|
|||
.category(Category::Bits)
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Performs bitwise xor for ints or binary values."
|
||||
}
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@ impl Command for Fmt {
|
|||
"fmt"
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Format a number."
|
||||
}
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@ impl Command for EachWhile {
|
|||
"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."
|
||||
}
|
||||
|
||||
|
|
|
@ -18,11 +18,11 @@ impl Command for Roll {
|
|||
.input_output_types(vec![(Type::Nothing, Type::String)])
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"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."
|
||||
}
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@ impl Command for RollDown {
|
|||
.category(Category::Filters)
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Roll table rows down."
|
||||
}
|
||||
|
||||
|
|
|
@ -33,7 +33,7 @@ impl Command for RollLeft {
|
|||
.category(Category::Filters)
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Roll record or table columns left."
|
||||
}
|
||||
|
||||
|
|
|
@ -33,7 +33,7 @@ impl Command for RollRight {
|
|||
.category(Category::Filters)
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Roll table columns right."
|
||||
}
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@ impl Command for RollUp {
|
|||
.category(Category::Filters)
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Roll table rows up."
|
||||
}
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@ impl Command for Rotate {
|
|||
.category(Category::Filters)
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Rotates a table or record clockwise (default) or counter-clockwise (use --ccw flag)."
|
||||
}
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@ impl Command for UpdateCells {
|
|||
.category(Category::Filters)
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Update the table cells."
|
||||
}
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@ impl Command for FromUrl {
|
|||
.category(Category::Formats)
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Parse url-encoded string as a record."
|
||||
}
|
||||
|
||||
|
|
|
@ -138,11 +138,11 @@ impl Command for ToHtml {
|
|||
]
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"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."
|
||||
}
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@ impl Command for SubCommand {
|
|||
.category(Category::Math)
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Returns the arccosine of the number."
|
||||
}
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@ impl Command for SubCommand {
|
|||
.category(Category::Math)
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Returns the inverse of the hyperbolic cosine function."
|
||||
}
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@ impl Command for SubCommand {
|
|||
.category(Category::Math)
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Returns the arcsine of the number."
|
||||
}
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@ impl Command for SubCommand {
|
|||
.category(Category::Math)
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Returns the inverse of the hyperbolic sine function."
|
||||
}
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@ impl Command for SubCommand {
|
|||
.category(Category::Math)
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Returns the arctangent of the number."
|
||||
}
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@ impl Command for SubCommand {
|
|||
.category(Category::Math)
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Returns the inverse of the hyperbolic tangent function."
|
||||
}
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@ impl Command for SubCommand {
|
|||
.category(Category::Math)
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Returns the cosine of the number."
|
||||
}
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@ impl Command for SubCommand {
|
|||
.category(Category::Math)
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Returns the hyperbolic cosine of the number."
|
||||
}
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@ impl Command for SubCommand {
|
|||
.category(Category::Math)
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Returns e raised to the power of x."
|
||||
}
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@ impl Command for SubCommand {
|
|||
.category(Category::Math)
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Returns the natural logarithm. Base: (math e)."
|
||||
}
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@ impl Command for SubCommand {
|
|||
.category(Category::Math)
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Returns the sine of the number."
|
||||
}
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@ impl Command for SubCommand {
|
|||
.category(Category::Math)
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Returns the hyperbolic sine of the number."
|
||||
}
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@ impl Command for SubCommand {
|
|||
.category(Category::Math)
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Returns the tangent of the number."
|
||||
}
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@ impl Command for SubCommand {
|
|||
.category(Category::Math)
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Returns the hyperbolic tangent of the number."
|
||||
}
|
||||
|
||||
|
|
|
@ -53,7 +53,7 @@ impl Command for SubCommand {
|
|||
.category(Category::Platform)
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Add a color gradient (using ANSI color codes) to the given string."
|
||||
}
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ impl Command for DecodeHex {
|
|||
.category(Category::Formats)
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Hex decode a value."
|
||||
}
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ impl Command for EncodeHex {
|
|||
.category(Category::Formats)
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Encode a binary value using hex."
|
||||
}
|
||||
|
||||
|
|
|
@ -24,7 +24,7 @@ impl Command for FormatPattern {
|
|||
.category(Category::Strings)
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Format columns into a string using a simple pattern."
|
||||
}
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@ impl Command for SubCommand {
|
|||
.category(Category::Strings)
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Convert a string to camelCase."
|
||||
}
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@ impl Command for SubCommand {
|
|||
.category(Category::Strings)
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Convert a string to kebab-case."
|
||||
}
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@ impl Command for SubCommand {
|
|||
.category(Category::Strings)
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Convert a string to PascalCase."
|
||||
}
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@ impl Command for SubCommand {
|
|||
.category(Category::Strings)
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Convert a string to SCREAMING_SNAKE_CASE."
|
||||
}
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@ impl Command for SubCommand {
|
|||
.category(Category::Strings)
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Convert a string to snake_case."
|
||||
}
|
||||
|
||||
|
|
|
@ -14,11 +14,11 @@ impl Command for Str {
|
|||
.input_output_types(vec![(Type::Nothing, Type::String)])
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"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."
|
||||
}
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@ impl Command for SubCommand {
|
|||
.category(Category::Strings)
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Convert a string to Title Case."
|
||||
}
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@ impl Command for Alias {
|
|||
"alias"
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Alias a command (with optional flags) to a new name."
|
||||
}
|
||||
|
||||
|
@ -25,7 +25,7 @@ impl Command for Alias {
|
|||
.category(Category::Core)
|
||||
}
|
||||
|
||||
fn extra_usage(&self) -> &str {
|
||||
fn extra_description(&self) -> &str {
|
||||
r#"This command is a parser keyword. For details, check:
|
||||
https://www.nushell.sh/book/thinking_in_nu.html"#
|
||||
}
|
||||
|
|
|
@ -9,7 +9,7 @@ impl Command for Break {
|
|||
"break"
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Break a loop."
|
||||
}
|
||||
|
||||
|
@ -19,7 +19,7 @@ impl Command for Break {
|
|||
.category(Category::Core)
|
||||
}
|
||||
|
||||
fn extra_usage(&self) -> &str {
|
||||
fn extra_description(&self) -> &str {
|
||||
r#"This command is a parser keyword. For details, check:
|
||||
https://www.nushell.sh/book/thinking_in_nu.html
|
||||
|
||||
|
|
|
@ -25,11 +25,11 @@ impl Command for Collect {
|
|||
.category(Category::Filters)
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"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.
|
||||
|
||||
The entire stream will be collected into one value in memory, so if the stream
|
||||
|
|
|
@ -9,7 +9,7 @@ impl Command for Const {
|
|||
"const"
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Create a parse-time constant."
|
||||
}
|
||||
|
||||
|
@ -26,7 +26,7 @@ impl Command for Const {
|
|||
.category(Category::Core)
|
||||
}
|
||||
|
||||
fn extra_usage(&self) -> &str {
|
||||
fn extra_description(&self) -> &str {
|
||||
r#"This command is a parser keyword. For details, check:
|
||||
https://www.nushell.sh/book/thinking_in_nu.html"#
|
||||
}
|
||||
|
|
|
@ -9,7 +9,7 @@ impl Command for Continue {
|
|||
"continue"
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Continue a loop from the next iteration."
|
||||
}
|
||||
|
||||
|
@ -19,7 +19,7 @@ impl Command for Continue {
|
|||
.category(Category::Core)
|
||||
}
|
||||
|
||||
fn extra_usage(&self) -> &str {
|
||||
fn extra_description(&self) -> &str {
|
||||
r#"This command is a parser keyword. For details, check:
|
||||
https://www.nushell.sh/book/thinking_in_nu.html
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@ impl Command for Def {
|
|||
"def"
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Define a custom command."
|
||||
}
|
||||
|
||||
|
@ -24,7 +24,7 @@ impl Command for Def {
|
|||
.category(Category::Core)
|
||||
}
|
||||
|
||||
fn extra_usage(&self) -> &str {
|
||||
fn extra_description(&self) -> &str {
|
||||
r#"This command is a parser keyword. For details, check:
|
||||
https://www.nushell.sh/book/thinking_in_nu.html"#
|
||||
}
|
||||
|
|
|
@ -9,7 +9,7 @@ impl Command for Describe {
|
|||
"describe"
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Describe the type and structure of the value(s) piped in."
|
||||
}
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@ impl Command for Do {
|
|||
"do"
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Run a closure, providing it with the pipeline input."
|
||||
}
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@ impl Command for Echo {
|
|||
"echo"
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Returns its arguments, ignoring the piped-in value."
|
||||
}
|
||||
|
||||
|
@ -19,7 +19,7 @@ impl Command for Echo {
|
|||
.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
|
||||
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
|
||||
|
|
|
@ -25,7 +25,7 @@ impl Command for ErrorMake {
|
|||
.category(Category::Core)
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Create an error."
|
||||
}
|
||||
|
||||
|
|
|
@ -15,11 +15,11 @@ impl Command for ExportCommand {
|
|||
.category(Category::Core)
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"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:
|
||||
https://www.nushell.sh/book/thinking_in_nu.html"#
|
||||
}
|
||||
|
|
|
@ -9,7 +9,7 @@ impl Command for ExportAlias {
|
|||
"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."
|
||||
}
|
||||
|
||||
|
@ -25,7 +25,7 @@ impl Command for ExportAlias {
|
|||
.category(Category::Core)
|
||||
}
|
||||
|
||||
fn extra_usage(&self) -> &str {
|
||||
fn extra_description(&self) -> &str {
|
||||
r#"This command is a parser keyword. For details, check:
|
||||
https://www.nushell.sh/book/thinking_in_nu.html"#
|
||||
}
|
||||
|
|
|
@ -9,7 +9,7 @@ impl Command for ExportConst {
|
|||
"export const"
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Use parse-time constant from a module and export them from this module."
|
||||
}
|
||||
|
||||
|
@ -26,7 +26,7 @@ impl Command for ExportConst {
|
|||
.category(Category::Core)
|
||||
}
|
||||
|
||||
fn extra_usage(&self) -> &str {
|
||||
fn extra_description(&self) -> &str {
|
||||
r#"This command is a parser keyword. For details, check:
|
||||
https://www.nushell.sh/book/thinking_in_nu.html"#
|
||||
}
|
||||
|
|
|
@ -9,7 +9,7 @@ impl Command for ExportDef {
|
|||
"export def"
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Define a custom command and export it from a module."
|
||||
}
|
||||
|
||||
|
@ -24,7 +24,7 @@ impl Command for ExportDef {
|
|||
.category(Category::Core)
|
||||
}
|
||||
|
||||
fn extra_usage(&self) -> &str {
|
||||
fn extra_description(&self) -> &str {
|
||||
r#"This command is a parser keyword. For details, check:
|
||||
https://www.nushell.sh/book/thinking_in_nu.html"#
|
||||
}
|
||||
|
|
|
@ -9,7 +9,7 @@ impl Command for ExportExtern {
|
|||
"export extern"
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Define an extern and export it from a module."
|
||||
}
|
||||
|
||||
|
@ -21,7 +21,7 @@ impl Command for ExportExtern {
|
|||
.category(Category::Core)
|
||||
}
|
||||
|
||||
fn extra_usage(&self) -> &str {
|
||||
fn extra_description(&self) -> &str {
|
||||
r#"This command is a parser keyword. For details, check:
|
||||
https://www.nushell.sh/book/thinking_in_nu.html"#
|
||||
}
|
||||
|
|
|
@ -9,7 +9,7 @@ impl Command for ExportModule {
|
|||
"export module"
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Export a custom module from a module."
|
||||
}
|
||||
|
||||
|
@ -26,7 +26,7 @@ impl Command for ExportModule {
|
|||
.category(Category::Core)
|
||||
}
|
||||
|
||||
fn extra_usage(&self) -> &str {
|
||||
fn extra_description(&self) -> &str {
|
||||
r#"This command is a parser keyword. For details, check:
|
||||
https://www.nushell.sh/book/thinking_in_nu.html"#
|
||||
}
|
||||
|
|
|
@ -9,7 +9,7 @@ impl Command for ExportUse {
|
|||
"export use"
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Use definitions from a module and export them from this module."
|
||||
}
|
||||
|
||||
|
@ -25,7 +25,7 @@ impl Command for ExportUse {
|
|||
.category(Category::Core)
|
||||
}
|
||||
|
||||
fn extra_usage(&self) -> &str {
|
||||
fn extra_description(&self) -> &str {
|
||||
r#"This command is a parser keyword. For details, check:
|
||||
https://www.nushell.sh/book/thinking_in_nu.html"#
|
||||
}
|
||||
|
|
|
@ -9,7 +9,7 @@ impl Command for Extern {
|
|||
"extern"
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Define a signature for an external command."
|
||||
}
|
||||
|
||||
|
@ -21,7 +21,7 @@ impl Command for Extern {
|
|||
.category(Category::Core)
|
||||
}
|
||||
|
||||
fn extra_usage(&self) -> &str {
|
||||
fn extra_description(&self) -> &str {
|
||||
r#"This command is a parser keyword. For details, check:
|
||||
https://www.nushell.sh/book/thinking_in_nu.html"#
|
||||
}
|
||||
|
|
|
@ -9,7 +9,7 @@ impl Command for For {
|
|||
"for"
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Loop over a range."
|
||||
}
|
||||
|
||||
|
@ -32,7 +32,7 @@ impl Command for For {
|
|||
.category(Category::Core)
|
||||
}
|
||||
|
||||
fn extra_usage(&self) -> &str {
|
||||
fn extra_description(&self) -> &str {
|
||||
r#"This command is a parser keyword. For details, check:
|
||||
https://www.nushell.sh/book/thinking_in_nu.html"#
|
||||
}
|
||||
|
|
|
@ -21,11 +21,11 @@ impl Command for Hide {
|
|||
.category(Category::Core)
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"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.
|
||||
|
||||
This command is a parser keyword. For details, check:
|
||||
|
|
|
@ -25,7 +25,7 @@ impl Command for HideEnv {
|
|||
.category(Category::Core)
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Hide environment variables in the current scope."
|
||||
}
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@ impl Command for If {
|
|||
"if"
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Conditionally run a block."
|
||||
}
|
||||
|
||||
|
@ -41,7 +41,7 @@ impl Command for If {
|
|||
.category(Category::Core)
|
||||
}
|
||||
|
||||
fn extra_usage(&self) -> &str {
|
||||
fn extra_description(&self) -> &str {
|
||||
r#"This command is a parser keyword. For details, check:
|
||||
https://www.nushell.sh/book/thinking_in_nu.html"#
|
||||
}
|
||||
|
|
|
@ -9,7 +9,7 @@ impl Command for Ignore {
|
|||
"ignore"
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Ignore the output of the previous command in the pipeline."
|
||||
}
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@ impl Command for Let {
|
|||
"let"
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Create a variable and give it a value."
|
||||
}
|
||||
|
||||
|
@ -26,7 +26,7 @@ impl Command for Let {
|
|||
.category(Category::Core)
|
||||
}
|
||||
|
||||
fn extra_usage(&self) -> &str {
|
||||
fn extra_description(&self) -> &str {
|
||||
r#"This command is a parser keyword. For details, check:
|
||||
https://www.nushell.sh/book/thinking_in_nu.html"#
|
||||
}
|
||||
|
|
|
@ -9,7 +9,7 @@ impl Command for Loop {
|
|||
"loop"
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Run a block in a loop."
|
||||
}
|
||||
|
||||
|
@ -21,7 +21,7 @@ impl Command for Loop {
|
|||
.category(Category::Core)
|
||||
}
|
||||
|
||||
fn extra_usage(&self) -> &str {
|
||||
fn extra_description(&self) -> &str {
|
||||
r#"This command is a parser keyword. For details, check:
|
||||
https://www.nushell.sh/book/thinking_in_nu.html"#
|
||||
}
|
||||
|
|
|
@ -11,7 +11,7 @@ impl Command for Match {
|
|||
"match"
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Conditionally run a block on a matched value."
|
||||
}
|
||||
|
||||
|
@ -27,7 +27,7 @@ impl Command for Match {
|
|||
.category(Category::Core)
|
||||
}
|
||||
|
||||
fn extra_usage(&self) -> &str {
|
||||
fn extra_description(&self) -> &str {
|
||||
r#"This command is a parser keyword. For details, check:
|
||||
https://www.nushell.sh/book/thinking_in_nu.html"#
|
||||
}
|
||||
|
|
|
@ -9,7 +9,7 @@ impl Command for Module {
|
|||
"module"
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Define a custom module."
|
||||
}
|
||||
|
||||
|
@ -26,7 +26,7 @@ impl Command for Module {
|
|||
.category(Category::Core)
|
||||
}
|
||||
|
||||
fn extra_usage(&self) -> &str {
|
||||
fn extra_description(&self) -> &str {
|
||||
r#"This command is a parser keyword. For details, check:
|
||||
https://www.nushell.sh/book/thinking_in_nu.html"#
|
||||
}
|
||||
|
|
|
@ -9,7 +9,7 @@ impl Command for Mut {
|
|||
"mut"
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Create a mutable variable and give it a value."
|
||||
}
|
||||
|
||||
|
@ -26,7 +26,7 @@ impl Command for Mut {
|
|||
.category(Category::Core)
|
||||
}
|
||||
|
||||
fn extra_usage(&self) -> &str {
|
||||
fn extra_description(&self) -> &str {
|
||||
r#"This command is a parser keyword. For details, check:
|
||||
https://www.nushell.sh/book/thinking_in_nu.html"#
|
||||
}
|
||||
|
|
|
@ -15,11 +15,11 @@ impl Command for Overlay {
|
|||
.input_output_types(vec![(Type::Nothing, Type::String)])
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Commands for manipulating overlays."
|
||||
}
|
||||
|
||||
fn extra_usage(&self) -> &str {
|
||||
fn extra_description(&self) -> &str {
|
||||
r#"This command is a parser keyword. For details, check:
|
||||
https://www.nushell.sh/book/thinking_in_nu.html
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@ impl Command for OverlayHide {
|
|||
"overlay hide"
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Hide an active overlay."
|
||||
}
|
||||
|
||||
|
@ -31,7 +31,7 @@ impl Command for OverlayHide {
|
|||
.category(Category::Core)
|
||||
}
|
||||
|
||||
fn extra_usage(&self) -> &str {
|
||||
fn extra_description(&self) -> &str {
|
||||
r#"This command is a parser keyword. For details, check:
|
||||
https://www.nushell.sh/book/thinking_in_nu.html"#
|
||||
}
|
||||
|
|
|
@ -8,7 +8,7 @@ impl Command for OverlayList {
|
|||
"overlay list"
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"List all active overlays."
|
||||
}
|
||||
|
||||
|
@ -18,7 +18,7 @@ impl Command for OverlayList {
|
|||
.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."
|
||||
}
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@ impl Command for OverlayNew {
|
|||
"overlay new"
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Create an empty overlay."
|
||||
}
|
||||
|
||||
|
@ -27,7 +27,7 @@ impl Command for OverlayNew {
|
|||
.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.
|
||||
|
||||
This command is a parser keyword. For details, check:
|
||||
|
|
|
@ -14,7 +14,7 @@ impl Command for OverlayUse {
|
|||
"overlay use"
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Use definitions from a module as an overlay."
|
||||
}
|
||||
|
||||
|
@ -45,7 +45,7 @@ impl Command for OverlayUse {
|
|||
.category(Category::Core)
|
||||
}
|
||||
|
||||
fn extra_usage(&self) -> &str {
|
||||
fn extra_description(&self) -> &str {
|
||||
r#"This command is a parser keyword. For details, check:
|
||||
https://www.nushell.sh/book/thinking_in_nu.html"#
|
||||
}
|
||||
|
|
|
@ -9,7 +9,7 @@ impl Command for Return {
|
|||
"return"
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Return early from a function."
|
||||
}
|
||||
|
||||
|
@ -24,7 +24,7 @@ impl Command for Return {
|
|||
.category(Category::Core)
|
||||
}
|
||||
|
||||
fn extra_usage(&self) -> &str {
|
||||
fn extra_description(&self) -> &str {
|
||||
r#"This command is a parser keyword. For details, check:
|
||||
https://www.nushell.sh/book/thinking_in_nu.html"#
|
||||
}
|
||||
|
|
|
@ -15,7 +15,7 @@ impl Command for ScopeAliases {
|
|||
.category(Category::Core)
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Output info on the aliases in the current scope."
|
||||
}
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@ impl Command for Scope {
|
|||
.allow_variants_without_examples(true)
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Commands for getting info about what is in scope."
|
||||
}
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@ impl Command for ScopeCommands {
|
|||
.category(Category::Core)
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Output info on the commands in the current scope."
|
||||
}
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@ impl Command for ScopeEngineStats {
|
|||
.category(Category::Core)
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Output stats on the engine in the current state."
|
||||
}
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@ impl Command for ScopeExterns {
|
|||
.category(Category::Core)
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Output info on the known externals in the current scope."
|
||||
}
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@ impl Command for ScopeModules {
|
|||
.category(Category::Core)
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Output info on the modules in the current scope."
|
||||
}
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@ impl Command for ScopeVariables {
|
|||
.category(Category::Core)
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"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
Loading…
Reference in a new issue