forked from extern/nushell
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
@ -51,7 +51,7 @@ impl Command for BytesAdd {
|
||||
.category(Category::Bytes)
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Add specified bytes to the input."
|
||||
}
|
||||
|
||||
|
@ -53,7 +53,7 @@ impl Command for BytesAt {
|
||||
.category(Category::Bytes)
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Get bytes defined by a range."
|
||||
}
|
||||
|
||||
|
@ -8,7 +8,7 @@ impl Command for BytesBuild {
|
||||
"bytes build"
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Create bytes from the arguments."
|
||||
}
|
||||
|
||||
|
@ -14,11 +14,11 @@ impl Command for Bytes {
|
||||
.input_output_types(vec![(Type::Nothing, Type::String)])
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Various commands for working with byte 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."
|
||||
}
|
||||
|
||||
|
@ -20,7 +20,7 @@ impl Command for BytesCollect {
|
||||
.category(Category::Bytes)
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Concatenate multiple binary into a single binary, with an optional separator between each."
|
||||
}
|
||||
|
||||
|
@ -41,7 +41,7 @@ impl Command for BytesEndsWith {
|
||||
.category(Category::Bytes)
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Check if bytes ends with a pattern."
|
||||
}
|
||||
|
||||
|
@ -47,7 +47,7 @@ impl Command for BytesIndexOf {
|
||||
.category(Category::Bytes)
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Returns start index of first occurrence of pattern in bytes, or -1 if no match."
|
||||
}
|
||||
|
||||
|
@ -29,7 +29,7 @@ impl Command for BytesLen {
|
||||
.category(Category::Bytes)
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Output the length of any bytes in the pipeline."
|
||||
}
|
||||
|
||||
|
@ -40,7 +40,7 @@ impl Command for BytesRemove {
|
||||
.category(Category::Bytes)
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Remove bytes."
|
||||
}
|
||||
|
||||
|
@ -41,7 +41,7 @@ impl Command for BytesReplace {
|
||||
.category(Category::Bytes)
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Find and replace binary."
|
||||
}
|
||||
|
||||
|
@ -25,7 +25,7 @@ impl Command for BytesReverse {
|
||||
.category(Category::Bytes)
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Reverse the bytes in the pipeline."
|
||||
}
|
||||
|
||||
|
@ -39,7 +39,7 @@ impl Command for BytesStartsWith {
|
||||
.category(Category::Bytes)
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Check if bytes starts with a pattern."
|
||||
}
|
||||
|
||||
|
@ -26,7 +26,7 @@ impl Command for Histogram {
|
||||
.category(Category::Chart)
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Creates a new table with a histogram based on the column name passed in."
|
||||
}
|
||||
|
||||
|
@ -32,7 +32,7 @@ impl Command for Fill {
|
||||
"fill"
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Fill and Align."
|
||||
}
|
||||
|
||||
|
@ -43,7 +43,7 @@ impl Command for SubCommand {
|
||||
.category(Category::Conversions)
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Convert value to a binary primitive."
|
||||
}
|
||||
|
||||
|
@ -29,7 +29,7 @@ impl Command for SubCommand {
|
||||
.category(Category::Conversions)
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Convert value to boolean."
|
||||
}
|
||||
|
||||
|
@ -25,7 +25,7 @@ impl Command for IntoCellPath {
|
||||
.allow_variants_without_examples(true)
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Convert value to a cell-path."
|
||||
}
|
||||
|
||||
@ -33,7 +33,7 @@ impl Command for IntoCellPath {
|
||||
vec!["convert"]
|
||||
}
|
||||
|
||||
fn extra_usage(&self) -> &str {
|
||||
fn extra_description(&self) -> &str {
|
||||
"Converting a string directly into a cell path is intentionally not supported."
|
||||
}
|
||||
|
||||
|
@ -14,11 +14,11 @@ impl Command for Into {
|
||||
.input_output_types(vec![(Type::Nothing, Type::String)])
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Commands to convert data from one type to another."
|
||||
}
|
||||
|
||||
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."
|
||||
}
|
||||
|
||||
|
@ -145,7 +145,7 @@ impl Command for SubCommand {
|
||||
}
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Convert text or timestamp into a datetime."
|
||||
}
|
||||
|
||||
|
@ -36,11 +36,11 @@ impl Command for SubCommand {
|
||||
.category(Category::Conversions)
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Convert value to duration."
|
||||
}
|
||||
|
||||
fn extra_usage(&self) -> &str {
|
||||
fn extra_description(&self) -> &str {
|
||||
"Max duration value is i64::MAX nanoseconds; max duration time unit is wk (weeks)."
|
||||
}
|
||||
|
||||
|
@ -51,7 +51,7 @@ impl Command for SubCommand {
|
||||
.category(Category::Conversions)
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Convert value to filesize."
|
||||
}
|
||||
|
||||
|
@ -32,7 +32,7 @@ impl Command for SubCommand {
|
||||
.category(Category::Conversions)
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Convert data into floating point number."
|
||||
}
|
||||
|
||||
|
@ -39,7 +39,7 @@ impl Command for SubCommand {
|
||||
.category(Category::Conversions)
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Convert value to glob."
|
||||
}
|
||||
|
||||
|
@ -89,7 +89,7 @@ impl Command for SubCommand {
|
||||
.category(Category::Conversions)
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Convert value to integer."
|
||||
}
|
||||
|
||||
|
@ -21,7 +21,7 @@ impl Command for SubCommand {
|
||||
.category(Category::Conversions)
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Convert value to record."
|
||||
}
|
||||
|
||||
|
@ -60,7 +60,7 @@ impl Command for SubCommand {
|
||||
.category(Category::Conversions)
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Convert value to string."
|
||||
}
|
||||
|
||||
|
@ -31,7 +31,7 @@ impl Command for IntoValue {
|
||||
.category(Category::Filters)
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Infer nushell datatype for each cell."
|
||||
}
|
||||
|
||||
|
@ -46,7 +46,7 @@ impl Command for IntoSqliteDb {
|
||||
operate(engine_state, stack, call, input)
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Convert table into a SQLite database."
|
||||
}
|
||||
|
||||
|
@ -27,7 +27,7 @@ impl Command for QueryDb {
|
||||
.category(Category::Database)
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Query a database using SQL."
|
||||
}
|
||||
|
||||
|
@ -17,7 +17,7 @@ impl Command for SchemaDb {
|
||||
.category(Category::Database)
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Show the schema of a SQLite database."
|
||||
}
|
||||
|
||||
|
@ -14,11 +14,11 @@ impl Command for Date {
|
||||
.input_output_types(vec![(Type::Nothing, Type::String)])
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Date-related commands."
|
||||
}
|
||||
|
||||
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 SubCommand {
|
||||
.category(Category::Date)
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Print a 'humanized' format for the date, relative to now."
|
||||
}
|
||||
|
||||
|
@ -15,7 +15,7 @@ impl Command for SubCommand {
|
||||
.category(Category::Date)
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"List supported time zones."
|
||||
}
|
||||
|
||||
|
@ -15,7 +15,7 @@ impl Command for SubCommand {
|
||||
.category(Category::Date)
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Get the current date."
|
||||
}
|
||||
|
||||
|
@ -20,7 +20,7 @@ impl Command for SubCommand {
|
||||
.category(Category::Date)
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Convert the date into a record."
|
||||
}
|
||||
|
||||
|
@ -20,7 +20,7 @@ impl Command for SubCommand {
|
||||
.category(Category::Date)
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Convert the date into a structured table."
|
||||
}
|
||||
|
||||
|
@ -19,11 +19,11 @@ impl Command for SubCommand {
|
||||
.category(Category::Date)
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Convert a date to a given time zone."
|
||||
}
|
||||
|
||||
fn extra_usage(&self) -> &str {
|
||||
fn extra_description(&self) -> &str {
|
||||
"Use 'date list-timezone' to list all supported time zones."
|
||||
}
|
||||
|
||||
|
@ -10,7 +10,7 @@ impl Command for Ast {
|
||||
"ast"
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Print the abstract syntax tree (ast) for a pipeline."
|
||||
}
|
||||
|
||||
|
@ -8,7 +8,7 @@ impl Command for Debug {
|
||||
"debug"
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Debug print the value(s) piped in."
|
||||
}
|
||||
|
||||
|
@ -12,7 +12,7 @@ impl Command for Explain {
|
||||
"explain"
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Explain closure contents."
|
||||
}
|
||||
|
||||
|
@ -20,11 +20,11 @@ impl Command for DebugInfo {
|
||||
"debug info"
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"View process memory info."
|
||||
}
|
||||
|
||||
fn extra_usage(&self) -> &str {
|
||||
fn extra_description(&self) -> &str {
|
||||
"This command is meant for debugging purposes.\nIt shows you the process information and system memory information."
|
||||
}
|
||||
|
||||
|
@ -10,7 +10,7 @@ impl Command for Inspect {
|
||||
"inspect"
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Inspect pipeline results while running a pipeline."
|
||||
}
|
||||
|
||||
|
@ -12,7 +12,7 @@ impl Command for Metadata {
|
||||
"metadata"
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Get the metadata for items in the stream."
|
||||
}
|
||||
|
||||
|
@ -9,7 +9,7 @@ impl Command for MetadataSet {
|
||||
"metadata set"
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Set the metadata for items in the stream."
|
||||
}
|
||||
|
||||
|
@ -43,11 +43,11 @@ impl Command for DebugProfile {
|
||||
.category(Category::Debug)
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Profile pipeline elements in a closure."
|
||||
}
|
||||
|
||||
fn extra_usage(&self) -> &str {
|
||||
fn extra_description(&self) -> &str {
|
||||
r#"The profiler profiles every evaluated pipeline element inside a closure, stepping into all
|
||||
commands calls and other blocks/closures.
|
||||
|
||||
|
@ -9,7 +9,7 @@ impl Command for TimeIt {
|
||||
"timeit"
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Time the running time of a block."
|
||||
}
|
||||
|
||||
|
@ -14,11 +14,11 @@ impl Command for View {
|
||||
.input_output_types(vec![(Type::Nothing, Type::String)])
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Various commands for viewing debug information."
|
||||
}
|
||||
|
||||
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."
|
||||
}
|
||||
|
||||
|
@ -8,11 +8,11 @@ impl Command for ViewFiles {
|
||||
"view files"
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"View the files registered in nushell's EngineState memory."
|
||||
}
|
||||
|
||||
fn extra_usage(&self) -> &str {
|
||||
fn extra_description(&self) -> &str {
|
||||
"These are files parsed and loaded at runtime."
|
||||
}
|
||||
|
||||
|
@ -29,11 +29,11 @@ impl Command for ViewIr {
|
||||
.category(Category::Debug)
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"View the compiled IR code for a block of code."
|
||||
}
|
||||
|
||||
fn extra_usage(&self) -> &str {
|
||||
fn extra_description(&self) -> &str {
|
||||
"
|
||||
The target can be a closure, the name of a custom command, or an internal block
|
||||
ID. Closure literals within IR dumps often reference the block by ID (e.g.
|
||||
|
@ -11,7 +11,7 @@ impl Command for ViewSource {
|
||||
"view source"
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"View a block, module, or a definition."
|
||||
}
|
||||
|
||||
|
@ -8,11 +8,11 @@ impl Command for ViewSpan {
|
||||
"view span"
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"View the contents of a span."
|
||||
}
|
||||
|
||||
fn extra_usage(&self) -> &str {
|
||||
fn extra_description(&self) -> &str {
|
||||
"This command is meant for debugging purposes.\nIt allows you to view the contents of nushell spans.\nOne way to get spans is to pipe something into 'debug --raw'.\nThen you can use the Span { start, end } values as the start and end values for this command."
|
||||
}
|
||||
|
||||
|
4
crates/nu-command/src/env/config/config_.rs
vendored
4
crates/nu-command/src/env/config/config_.rs
vendored
@ -14,11 +14,11 @@ impl Command for ConfigMeta {
|
||||
.input_output_types(vec![(Type::Nothing, Type::String)])
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Edit nushell configuration files."
|
||||
}
|
||||
|
||||
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."
|
||||
}
|
||||
|
||||
|
@ -19,7 +19,7 @@ impl Command for ConfigEnv {
|
||||
// TODO: Signature narrower than what run actually supports theoretically
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Edit nu environment configurations."
|
||||
}
|
||||
|
||||
|
@ -23,7 +23,7 @@ impl Command for ConfigNu {
|
||||
// TODO: Signature narrower than what run actually supports theoretically
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Edit nu configurations."
|
||||
}
|
||||
|
||||
|
@ -22,7 +22,7 @@ impl Command for ConfigReset {
|
||||
.category(Category::Env)
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Reset nushell environment configurations to default, and saves old config files in the config location as oldconfig.nu and oldenv.nu."
|
||||
}
|
||||
|
||||
|
4
crates/nu-command/src/env/export_env.rs
vendored
4
crates/nu-command/src/env/export_env.rs
vendored
@ -20,11 +20,11 @@ impl Command for ExportEnv {
|
||||
.category(Category::Env)
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Run a block and preserve its environment in a current scope."
|
||||
}
|
||||
|
||||
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"#
|
||||
}
|
||||
|
2
crates/nu-command/src/env/load_env.rs
vendored
2
crates/nu-command/src/env/load_env.rs
vendored
@ -8,7 +8,7 @@ impl Command for LoadEnv {
|
||||
"load-env"
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Loads an environment update from a record."
|
||||
}
|
||||
|
||||
|
4
crates/nu-command/src/env/source_env.rs
vendored
4
crates/nu-command/src/env/source_env.rs
vendored
@ -25,11 +25,11 @@ impl Command for SourceEnv {
|
||||
.category(Category::Core)
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Source the environment from a source file into the current environment."
|
||||
}
|
||||
|
||||
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"#
|
||||
}
|
||||
|
2
crates/nu-command/src/env/with_env.rs
vendored
2
crates/nu-command/src/env/with_env.rs
vendored
@ -25,7 +25,7 @@ impl Command for WithEnv {
|
||||
.category(Category::Env)
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Runs a block with an environment variable set."
|
||||
}
|
||||
|
||||
|
@ -8,7 +8,7 @@ impl Command for IsAdmin {
|
||||
"is-admin"
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Check if nushell is running with administrator or root privileges."
|
||||
}
|
||||
|
||||
|
@ -10,7 +10,7 @@ impl Command for Cd {
|
||||
"cd"
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Change directory."
|
||||
}
|
||||
|
||||
|
@ -27,7 +27,7 @@ impl Command for Du {
|
||||
"du"
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Find disk usage sizes of specified items."
|
||||
}
|
||||
|
||||
|
@ -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"#
|
||||
}
|
||||
|
||||
|
@ -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."
|
||||
}
|
||||
|
||||
|
@ -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."
|
||||
}
|
||||
|
||||
|
@ -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."
|
||||
}
|
||||
|
||||
|
@ -25,7 +25,7 @@ impl Command for Rm {
|
||||
"rm"
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Remove files and directories."
|
||||
}
|
||||
|
||||
|
@ -22,7 +22,7 @@ impl Command for Save {
|
||||
"save"
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Save a 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."
|
||||
}
|
||||
|
||||
|
@ -51,7 +51,7 @@ impl Command for Touch {
|
||||
.category(Category::FileSystem)
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Creates one or more files."
|
||||
}
|
||||
|
||||
|
@ -20,7 +20,7 @@ impl Command for UCp {
|
||||
"cp"
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Copy files using uutils/coreutils cp."
|
||||
}
|
||||
|
||||
|
@ -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."
|
||||
}
|
||||
|
||||
|
@ -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."
|
||||
}
|
||||
|
||||
|
@ -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."
|
||||
}
|
||||
|
||||
|
@ -20,7 +20,7 @@ impl Command for All {
|
||||
.category(Category::Filters)
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Test if every element of the input fulfills a predicate expression."
|
||||
}
|
||||
|
||||
|
@ -20,7 +20,7 @@ impl Command for Any {
|
||||
.category(Category::Filters)
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Tests if any element of the input fulfills a predicate expression."
|
||||
}
|
||||
|
||||
|
@ -20,11 +20,11 @@ impl Command for Append {
|
||||
.category(Category::Filters)
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Append any number of rows to a table."
|
||||
}
|
||||
|
||||
fn extra_usage(&self) -> &str {
|
||||
fn extra_description(&self) -> &str {
|
||||
r#"Be aware that this command 'unwraps' lists passed to it. So, if you pass a variable to it,
|
||||
and you want the variable's contents to be appended without being unwrapped, it's wise to
|
||||
pre-emptively wrap the variable in a list, like so: `append [$val]`. This way, `append` will
|
||||
|
@ -20,11 +20,11 @@ impl Command for Chunks {
|
||||
.category(Category::Filters)
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Divide a list or table into chunks of `chunk_size`."
|
||||
}
|
||||
|
||||
fn extra_usage(&self) -> &str {
|
||||
fn extra_description(&self) -> &str {
|
||||
"This command will error if `chunk_size` is negative or zero."
|
||||
}
|
||||
|
||||
|
@ -17,11 +17,11 @@ impl Command for Columns {
|
||||
.category(Category::Filters)
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Given a record or table, produce a list of its columns' names."
|
||||
}
|
||||
|
||||
fn extra_usage(&self) -> &str {
|
||||
fn extra_description(&self) -> &str {
|
||||
"This is a counterpart to `values`, which produces a list of columns' values."
|
||||
}
|
||||
|
||||
|
@ -27,7 +27,7 @@ impl Command for Compact {
|
||||
.category(Category::Filters)
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Creates a table with non-empty rows."
|
||||
}
|
||||
|
||||
|
@ -26,7 +26,7 @@ impl Command for Default {
|
||||
.category(Category::Filters)
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Sets a default value if a row's column is missing or null."
|
||||
}
|
||||
|
||||
|
@ -24,7 +24,7 @@ impl Command for DropColumn {
|
||||
.category(Category::Filters)
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Remove N columns at the right-hand end of the input table. To remove columns by name, use `reject`."
|
||||
}
|
||||
|
||||
|
@ -21,7 +21,7 @@ impl Command for Drop {
|
||||
.category(Category::Filters)
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Remove items/rows from the end of the input list/table. Counterpart of `skip`. Opposite of `last`."
|
||||
}
|
||||
|
||||
|
@ -27,7 +27,7 @@ impl Command for DropNth {
|
||||
.category(Category::Filters)
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Drop the selected rows."
|
||||
}
|
||||
|
||||
|
@ -10,11 +10,11 @@ impl Command for Each {
|
||||
"each"
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Run a closure on each row of the input list, creating a new list with the results."
|
||||
}
|
||||
|
||||
fn extra_usage(&self) -> &str {
|
||||
fn extra_description(&self) -> &str {
|
||||
r#"Since tables are lists of records, passing a table into 'each' will
|
||||
iterate over each record, not necessarily each cell within it.
|
||||
|
||||
|
@ -8,7 +8,7 @@ impl Command for Enumerate {
|
||||
"enumerate"
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Enumerate the elements in a stream."
|
||||
}
|
||||
|
||||
|
@ -27,7 +27,7 @@ impl Command for Every {
|
||||
.category(Category::Filters)
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Show (or skip) every n-th row, starting from the first one."
|
||||
}
|
||||
|
||||
|
@ -10,11 +10,11 @@ impl Command for Filter {
|
||||
"filter"
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Filter values based on a predicate closure."
|
||||
}
|
||||
|
||||
fn extra_usage(&self) -> &str {
|
||||
fn extra_description(&self) -> &str {
|
||||
r#"This command works similar to 'where' but allows reading the predicate closure from
|
||||
a variable. On the other hand, the "row condition" syntax is not supported."#
|
||||
}
|
||||
|
@ -57,7 +57,7 @@ impl Command for Find {
|
||||
.category(Category::Filters)
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Searches terms in the input."
|
||||
}
|
||||
|
||||
|
@ -31,7 +31,7 @@ impl Command for First {
|
||||
.category(Category::Filters)
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Return only the first several rows of the input. Counterpart of `last`. Opposite of `skip`."
|
||||
}
|
||||
|
||||
|
@ -28,7 +28,7 @@ impl Command for Flatten {
|
||||
.category(Category::Filters)
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Flatten the table."
|
||||
}
|
||||
|
||||
|
@ -8,11 +8,11 @@ impl Command for Get {
|
||||
"get"
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Extract data using a cell path."
|
||||
}
|
||||
|
||||
fn extra_usage(&self) -> &str {
|
||||
fn extra_description(&self) -> &str {
|
||||
r#"This is equivalent to using the cell path access syntax: `$env.OS` is the same as `$env | get OS`.
|
||||
|
||||
If multiple cell paths are given, this will produce a list of values."#
|
||||
|
@ -23,7 +23,7 @@ impl Command for Group {
|
||||
.category(Category::Filters)
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Groups input into groups of `group_size`."
|
||||
}
|
||||
|
||||
|
@ -34,7 +34,7 @@ impl Command for GroupBy {
|
||||
.category(Category::Filters)
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Splits a list or table into groups, and returns a record containing those groups."
|
||||
}
|
||||
|
||||
|
@ -22,7 +22,7 @@ impl Command for Headers {
|
||||
.category(Category::Filters)
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Use the first row of the table as column names."
|
||||
}
|
||||
|
||||
|
@ -33,11 +33,11 @@ impl Command for Insert {
|
||||
.category(Category::Filters)
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Insert a new column, using an expression or closure to create each row's values."
|
||||
}
|
||||
|
||||
fn extra_usage(&self) -> &str {
|
||||
fn extra_description(&self) -> &str {
|
||||
"When inserting a column, the closure will be run for each row, and the current row will be passed as the first argument.
|
||||
When inserting into a specific index, the closure will instead get the current value at the index or null if inserting at the end of a list/table."
|
||||
}
|
||||
|
@ -10,11 +10,11 @@ impl Command for Interleave {
|
||||
"interleave"
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Read multiple streams in parallel and combine them into one stream."
|
||||
}
|
||||
|
||||
fn extra_usage(&self) -> &str {
|
||||
fn extra_description(&self) -> &str {
|
||||
r#"This combinator is useful for reading output from multiple commands.
|
||||
|
||||
If input is provided to `interleave`, the input will be combined with the
|
||||
|
@ -20,7 +20,7 @@ impl Command for IsEmpty {
|
||||
.category(Category::Filters)
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Check for empty values."
|
||||
}
|
||||
|
||||
|
@ -20,7 +20,7 @@ impl Command for IsNotEmpty {
|
||||
.category(Category::Filters)
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Check for non-empty values."
|
||||
}
|
||||
|
||||
|
@ -22,11 +22,11 @@ impl Command for Items {
|
||||
.category(Category::Filters)
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
fn description(&self) -> &str {
|
||||
"Given a record, iterate on each pair of column name and associated value."
|
||||
}
|
||||
|
||||
fn extra_usage(&self) -> &str {
|
||||
fn extra_description(&self) -> &str {
|
||||
"This is a the fusion of `columns`, `values` and `each`."
|
||||
}
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user