forked from extern/nushell
Enforce required, optional, and rest positional arguments start with an uppercase and end with a period. (#11285)
# Description This updates all the positional arguments (except with `--features=dataframe` or `--features=extra`) to start with an uppercase letter and end with a period. Part of #5066, specifically [this comment](/nushell/nushell/issues/5066#issuecomment-1421528910) Some arguments had example data removed from them because it also appears in the examples. There are other inconsistencies in positional arguments I noticed while making the tests pass which I will bring up in #5066. # User-Facing Changes Positional arguments are now consistent # Tests + Formatting - 🟢 `toolkit fmt` - 🟢 `toolkit clippy` - 🟢 `toolkit test` - 🟢 `toolkit test stdlib` # After Submitting Automatic documentation updates
This commit is contained in:
@ -40,7 +40,7 @@ impl Command for BytesAdd {
|
||||
(Type::Record(vec![]), Type::Record(vec![])),
|
||||
])
|
||||
.allow_variants_without_examples(true)
|
||||
.required("data", SyntaxShape::Binary, "the binary to add")
|
||||
.required("data", SyntaxShape::Binary, "The binary to add.")
|
||||
.named(
|
||||
"index",
|
||||
SyntaxShape::Int,
|
||||
@ -51,7 +51,7 @@ impl Command for BytesAdd {
|
||||
.rest(
|
||||
"rest",
|
||||
SyntaxShape::CellPath,
|
||||
"for a data structure input, add bytes to the data at the given cell paths",
|
||||
"For a data structure input, add bytes to the data at the given cell paths.",
|
||||
)
|
||||
.category(Category::Bytes)
|
||||
}
|
||||
|
@ -47,11 +47,11 @@ impl Command for BytesAt {
|
||||
(Type::Table(vec![]), Type::Table(vec![])),
|
||||
(Type::Record(vec![]), Type::Record(vec![])),
|
||||
])
|
||||
.required("range", SyntaxShape::Range, "the range to get bytes")
|
||||
.required("range", SyntaxShape::Range, "The range to get bytes.")
|
||||
.rest(
|
||||
"rest",
|
||||
SyntaxShape::CellPath,
|
||||
"for a data structure input, get bytes from data at the given cell paths",
|
||||
"For a data structure input, get bytes from data at the given cell paths.",
|
||||
)
|
||||
.category(Category::Bytes)
|
||||
}
|
||||
|
@ -25,7 +25,7 @@ impl Command for BytesBuild {
|
||||
fn signature(&self) -> nu_protocol::Signature {
|
||||
Signature::build("bytes build")
|
||||
.input_output_types(vec![(Type::Nothing, Type::Binary)])
|
||||
.rest("rest", SyntaxShape::Any, "list of bytes")
|
||||
.rest("rest", SyntaxShape::Any, "List of bytes.")
|
||||
.category(Category::Bytes)
|
||||
}
|
||||
|
||||
|
@ -20,7 +20,7 @@ impl Command for BytesCollect {
|
||||
.optional(
|
||||
"separator",
|
||||
SyntaxShape::Binary,
|
||||
"optional separator to use when creating binary",
|
||||
"Optional separator to use when creating binary.",
|
||||
)
|
||||
.category(Category::Bytes)
|
||||
}
|
||||
|
@ -33,11 +33,11 @@ impl Command for BytesEndsWith {
|
||||
(Type::Record(vec![]), Type::Record(vec![])),
|
||||
])
|
||||
.allow_variants_without_examples(true)
|
||||
.required("pattern", SyntaxShape::Binary, "the pattern to match")
|
||||
.required("pattern", SyntaxShape::Binary, "The pattern to match.")
|
||||
.rest(
|
||||
"rest",
|
||||
SyntaxShape::CellPath,
|
||||
"for a data structure input, check if bytes at the given cell paths end with the pattern",
|
||||
"For a data structure input, check if bytes at the given cell paths end with the pattern.",
|
||||
)
|
||||
.category(Category::Bytes)
|
||||
}
|
||||
|
@ -41,12 +41,12 @@ impl Command for BytesIndexOf {
|
||||
.required(
|
||||
"pattern",
|
||||
SyntaxShape::Binary,
|
||||
"the pattern to find index of",
|
||||
"The pattern to find index of.",
|
||||
)
|
||||
.rest(
|
||||
"rest",
|
||||
SyntaxShape::CellPath,
|
||||
"for a data structure input, find the indexes at the given cell paths",
|
||||
"For a data structure input, find the indexes at the given cell paths.",
|
||||
)
|
||||
.switch("all", "returns all matched index", Some('a'))
|
||||
.switch("end", "search from the end of the binary", Some('e'))
|
||||
|
@ -29,7 +29,7 @@ impl Command for BytesLen {
|
||||
.rest(
|
||||
"rest",
|
||||
SyntaxShape::CellPath,
|
||||
"for a data structure input, find the length of data at the given cell paths",
|
||||
"For a data structure input, find the length of data at the given cell paths.",
|
||||
)
|
||||
.category(Category::Bytes)
|
||||
}
|
||||
|
@ -35,11 +35,11 @@ impl Command for BytesRemove {
|
||||
(Type::Table(vec![]), Type::Table(vec![])),
|
||||
(Type::Record(vec![]), Type::Record(vec![])),
|
||||
])
|
||||
.required("pattern", SyntaxShape::Binary, "the pattern to find")
|
||||
.required("pattern", SyntaxShape::Binary, "The pattern to find.")
|
||||
.rest(
|
||||
"rest",
|
||||
SyntaxShape::CellPath,
|
||||
"for a data structure input, remove bytes from data at the given cell paths",
|
||||
"For a data structure input, remove bytes from data at the given cell paths.",
|
||||
)
|
||||
.switch("end", "remove from end of binary", Some('e'))
|
||||
.switch("all", "remove occurrences of finding binary", Some('a'))
|
||||
|
@ -36,12 +36,12 @@ impl Command for BytesReplace {
|
||||
(Type::Record(vec![]), Type::Record(vec![])),
|
||||
])
|
||||
.allow_variants_without_examples(true)
|
||||
.required("find", SyntaxShape::Binary, "the pattern to find")
|
||||
.required("replace", SyntaxShape::Binary, "the replacement pattern")
|
||||
.required("find", SyntaxShape::Binary, "The pattern to find.")
|
||||
.required("replace", SyntaxShape::Binary, "The replacement pattern.")
|
||||
.rest(
|
||||
"rest",
|
||||
SyntaxShape::CellPath,
|
||||
"for a data structure input, replace bytes in data at the given cell paths",
|
||||
"For a data structure input, replace bytes in data at the given cell paths.",
|
||||
)
|
||||
.switch("all", "replace all occurrences of find binary", Some('a'))
|
||||
.category(Category::Bytes)
|
||||
|
@ -26,7 +26,7 @@ impl Command for BytesReverse {
|
||||
.rest(
|
||||
"rest",
|
||||
SyntaxShape::CellPath,
|
||||
"for a data structure input, reverse data at the given cell paths",
|
||||
"For a data structure input, reverse data at the given cell paths.",
|
||||
)
|
||||
.category(Category::Bytes)
|
||||
}
|
||||
|
@ -35,11 +35,11 @@ impl Command for BytesStartsWith {
|
||||
(Type::Record(vec![]), Type::Record(vec![])),
|
||||
])
|
||||
.allow_variants_without_examples(true)
|
||||
.required("pattern", SyntaxShape::Binary, "the pattern to match")
|
||||
.required("pattern", SyntaxShape::Binary, "The pattern to match.")
|
||||
.rest(
|
||||
"rest",
|
||||
SyntaxShape::CellPath,
|
||||
"for a data structure input, check if bytes at the given cell paths start with the pattern",
|
||||
"For a data structure input, check if bytes at the given cell paths start with the pattern.",
|
||||
)
|
||||
.category(Category::Bytes)
|
||||
}
|
||||
|
@ -25,8 +25,8 @@ impl Command for Histogram {
|
||||
fn signature(&self) -> Signature {
|
||||
Signature::build("histogram")
|
||||
.input_output_types(vec![(Type::List(Box::new(Type::Any)), Type::Table(vec![])),])
|
||||
.optional("column-name", SyntaxShape::String, "column name to calc frequency, no need to provide if input is just a list")
|
||||
.optional("frequency-column-name", SyntaxShape::String, "histogram's frequency column, default to be frequency column output")
|
||||
.optional("column-name", SyntaxShape::String, "Column name to calc frequency, no need to provide if input is a list.")
|
||||
.optional("frequency-column-name", SyntaxShape::String, "Histogram's frequency column, default to be frequency column output.")
|
||||
.named("percentage-type", SyntaxShape::String, "percentage calculate method, can be 'normalize' or 'relative', in 'normalize', defaults to be 'normalize'", Some('t'))
|
||||
.category(Category::Chart)
|
||||
}
|
||||
|
@ -44,7 +44,7 @@ impl Command for SubCommand {
|
||||
.rest(
|
||||
"rest",
|
||||
SyntaxShape::CellPath,
|
||||
"for a data structure input, convert data at the given cell paths",
|
||||
"For a data structure input, convert data at the given cell paths.",
|
||||
)
|
||||
.category(Category::Conversions)
|
||||
}
|
||||
|
@ -29,7 +29,7 @@ impl Command for SubCommand {
|
||||
.rest(
|
||||
"rest",
|
||||
SyntaxShape::CellPath,
|
||||
"for a data structure input, convert data at the given cell paths",
|
||||
"For a data structure input, convert data at the given cell paths.",
|
||||
)
|
||||
.category(Category::Conversions)
|
||||
}
|
||||
|
@ -104,7 +104,7 @@ impl Command for SubCommand {
|
||||
.rest(
|
||||
"rest",
|
||||
SyntaxShape::CellPath,
|
||||
"for a data structure input, convert data at the given cell paths",
|
||||
"For a data structure input, convert data at the given cell paths.",
|
||||
)
|
||||
.category(Category::Conversions)
|
||||
}
|
||||
|
@ -36,7 +36,7 @@ impl Command for SubCommand {
|
||||
.rest(
|
||||
"rest",
|
||||
SyntaxShape::CellPath,
|
||||
"for a data structure input, convert data at the given cell paths",
|
||||
"For a data structure input, convert data at the given cell paths.",
|
||||
)
|
||||
.category(Category::Conversions)
|
||||
}
|
||||
|
@ -49,7 +49,7 @@ impl Command for SubCommand {
|
||||
.rest(
|
||||
"rest",
|
||||
SyntaxShape::CellPath,
|
||||
"for a data structure input, convert data at the given cell paths",
|
||||
"For a data structure input, convert data at the given cell paths.",
|
||||
)
|
||||
.category(Category::Conversions)
|
||||
}
|
||||
|
@ -31,7 +31,7 @@ impl Command for SubCommand {
|
||||
.rest(
|
||||
"rest",
|
||||
SyntaxShape::CellPath,
|
||||
"for a data structure input, convert data at the given cell paths",
|
||||
"For a data structure input, convert data at the given cell paths.",
|
||||
)
|
||||
.allow_variants_without_examples(true)
|
||||
.category(Category::Conversions)
|
||||
|
@ -81,7 +81,7 @@ impl Command for SubCommand {
|
||||
.rest(
|
||||
"rest",
|
||||
SyntaxShape::CellPath,
|
||||
"for a data structure input, convert data at the given cell paths",
|
||||
"For a data structure input, convert data at the given cell paths.",
|
||||
)
|
||||
.category(Category::Conversions)
|
||||
}
|
||||
|
@ -52,7 +52,7 @@ impl Command for SubCommand {
|
||||
.rest(
|
||||
"rest",
|
||||
SyntaxShape::CellPath,
|
||||
"for a data structure input, convert data at the given cell paths",
|
||||
"For a data structure input, convert data at the given cell paths.",
|
||||
)
|
||||
.named(
|
||||
"decimals",
|
||||
|
@ -25,7 +25,7 @@ impl Command for IntoSqliteDb {
|
||||
.required(
|
||||
"file_name",
|
||||
SyntaxShape::String,
|
||||
"Specify the filename to save the database to",
|
||||
"Specify the filename to save the database to.",
|
||||
)
|
||||
.named(
|
||||
"table_name",
|
||||
|
@ -22,7 +22,7 @@ impl Command for QueryDb {
|
||||
.required(
|
||||
"SQL",
|
||||
SyntaxShape::String,
|
||||
"SQL to execute against the database",
|
||||
"SQL to execute against the database.",
|
||||
)
|
||||
.category(Category::Database)
|
||||
}
|
||||
|
@ -22,7 +22,7 @@ impl Command for SubCommand {
|
||||
Signature::build("date to-timezone")
|
||||
.input_output_types(vec![(Type::Date, Type::Date), (Type::String, Type::Date)])
|
||||
.allow_variants_without_examples(true) // https://github.com/nushell/nushell/issues/7032
|
||||
.required("time zone", SyntaxShape::String, "time zone description")
|
||||
.required("time zone", SyntaxShape::String, "Time zone description.")
|
||||
.category(Category::Date)
|
||||
}
|
||||
|
||||
|
@ -25,7 +25,7 @@ impl Command for Ast {
|
||||
.required(
|
||||
"pipeline",
|
||||
SyntaxShape::String,
|
||||
"the pipeline to print the ast for",
|
||||
"The pipeline to print the ast for.",
|
||||
)
|
||||
.switch("json", "serialize to json", Some('j'))
|
||||
.switch("minify", "minify the nuon or json output", Some('m'))
|
||||
|
@ -23,7 +23,7 @@ impl Command for Explain {
|
||||
.required(
|
||||
"closure",
|
||||
SyntaxShape::Closure(Some(vec![SyntaxShape::Any])),
|
||||
"the closure to run",
|
||||
"The closure to run.",
|
||||
)
|
||||
.input_output_types(vec![(Type::Any, Type::Any), (Type::Nothing, Type::Any)])
|
||||
.allow_variants_without_examples(true)
|
||||
|
@ -25,7 +25,7 @@ impl Command for Metadata {
|
||||
.optional(
|
||||
"expression",
|
||||
SyntaxShape::Any,
|
||||
"the expression you want metadata for",
|
||||
"The expression you want metadata for.",
|
||||
)
|
||||
.category(Category::Debug)
|
||||
}
|
||||
|
@ -24,7 +24,7 @@ impl Command for TimeIt {
|
||||
.required(
|
||||
"command",
|
||||
SyntaxShape::OneOf(vec![SyntaxShape::Block, SyntaxShape::Expression]),
|
||||
"the command or block to run",
|
||||
"The command or block to run.",
|
||||
)
|
||||
.input_output_types(vec![
|
||||
(Type::Any, Type::Duration),
|
||||
|
@ -22,7 +22,7 @@ impl Command for ViewSource {
|
||||
fn signature(&self) -> nu_protocol::Signature {
|
||||
Signature::build("view source")
|
||||
.input_output_types(vec![(Type::Nothing, Type::String)])
|
||||
.required("item", SyntaxShape::Any, "name or block to view")
|
||||
.required("item", SyntaxShape::Any, "Name or block to view.")
|
||||
.category(Category::Debug)
|
||||
}
|
||||
|
||||
|
@ -25,8 +25,8 @@ impl Command for ViewSpan {
|
||||
fn signature(&self) -> nu_protocol::Signature {
|
||||
Signature::build("view span")
|
||||
.input_output_types(vec![(Type::Nothing, Type::String)])
|
||||
.required("start", SyntaxShape::Int, "start of the span")
|
||||
.required("end", SyntaxShape::Int, "end of the span")
|
||||
.required("start", SyntaxShape::Int, "Start of the span.")
|
||||
.required("end", SyntaxShape::Int, "End of the span.")
|
||||
.category(Category::Debug)
|
||||
}
|
||||
|
||||
|
2
crates/nu-command/src/env/export_env.rs
vendored
2
crates/nu-command/src/env/export_env.rs
vendored
@ -19,7 +19,7 @@ impl Command for ExportEnv {
|
||||
.required(
|
||||
"block",
|
||||
SyntaxShape::Block,
|
||||
"the block to run to set the environment",
|
||||
"The block to run to set the environment.",
|
||||
)
|
||||
.category(Category::Env)
|
||||
}
|
||||
|
2
crates/nu-command/src/env/load_env.rs
vendored
2
crates/nu-command/src/env/load_env.rs
vendored
@ -27,7 +27,7 @@ impl Command for LoadEnv {
|
||||
.optional(
|
||||
"update",
|
||||
SyntaxShape::Record(vec![]),
|
||||
"the record to use for updates",
|
||||
"The record to use for updates.",
|
||||
)
|
||||
.category(Category::FileSystem)
|
||||
}
|
||||
|
2
crates/nu-command/src/env/source_env.rs
vendored
2
crates/nu-command/src/env/source_env.rs
vendored
@ -24,7 +24,7 @@ impl Command for SourceEnv {
|
||||
.required(
|
||||
"filename",
|
||||
SyntaxShape::String, // type is string to avoid automatically canonicalizing the path
|
||||
"the filepath to the script file to source the environment from",
|
||||
"The filepath to the script file to source the environment from.",
|
||||
)
|
||||
.category(Category::Core)
|
||||
}
|
||||
|
4
crates/nu-command/src/env/with_env.rs
vendored
4
crates/nu-command/src/env/with_env.rs
vendored
@ -21,12 +21,12 @@ impl Command for WithEnv {
|
||||
.required(
|
||||
"variable",
|
||||
SyntaxShape::Any,
|
||||
"the environment variable to temporarily set",
|
||||
"The environment variable to temporarily set.",
|
||||
)
|
||||
.required(
|
||||
"block",
|
||||
SyntaxShape::Closure(None),
|
||||
"the block to run once the variable is set",
|
||||
"The block to run once the variable is set.",
|
||||
)
|
||||
.category(Category::Env)
|
||||
}
|
||||
|
@ -43,7 +43,7 @@ impl Command for Cd {
|
||||
fn signature(&self) -> nu_protocol::Signature {
|
||||
Signature::build("cd")
|
||||
.input_output_types(vec![(Type::Nothing, Type::Nothing)])
|
||||
.optional("path", SyntaxShape::Directory, "the path to change to")
|
||||
.optional("path", SyntaxShape::Directory, "The path to change to.")
|
||||
.input_output_types(vec![
|
||||
(Type::Nothing, Type::Nothing),
|
||||
(Type::String, Type::Nothing),
|
||||
|
@ -39,8 +39,8 @@ impl Command for Cp {
|
||||
fn signature(&self) -> Signature {
|
||||
Signature::build("cp-old")
|
||||
.input_output_types(vec![(Type::Nothing, Type::Nothing)])
|
||||
.required("source", SyntaxShape::GlobPattern, "the place to copy from")
|
||||
.required("destination", SyntaxShape::Filepath, "the place to copy to")
|
||||
.required("source", SyntaxShape::GlobPattern, "The place to copy from.")
|
||||
.required("destination", SyntaxShape::Filepath, "The place to copy to.")
|
||||
.switch(
|
||||
"recursive",
|
||||
"copy recursively through subdirectories",
|
||||
|
@ -21,7 +21,7 @@ impl Command for Glob {
|
||||
fn signature(&self) -> Signature {
|
||||
Signature::build("glob")
|
||||
.input_output_types(vec![(Type::Nothing, Type::List(Box::new(Type::String)))])
|
||||
.required("glob", SyntaxShape::String, "the glob expression")
|
||||
.required("glob", SyntaxShape::String, "The glob expression.")
|
||||
.named(
|
||||
"depth",
|
||||
SyntaxShape::Int,
|
||||
|
@ -39,7 +39,7 @@ impl Command for Ls {
|
||||
Signature::build("ls")
|
||||
.input_output_types(vec![(Type::Nothing, Type::Table(vec![]))])
|
||||
// Using a string instead of a glob pattern shape so it won't auto-expand
|
||||
.optional("pattern", SyntaxShape::String, "the glob pattern to use")
|
||||
.optional("pattern", SyntaxShape::String, "The glob pattern to use.")
|
||||
.switch("all", "Show hidden files", Some('a'))
|
||||
.switch(
|
||||
"long",
|
||||
|
@ -23,7 +23,7 @@ impl Command for Mkdir {
|
||||
.rest(
|
||||
"rest",
|
||||
SyntaxShape::Directory,
|
||||
"the name(s) of the path(s) to create",
|
||||
"The name(s) of the path(s) to create.",
|
||||
)
|
||||
.switch("verbose", "print created path(s).", Some('v'))
|
||||
.category(Category::FileSystem)
|
||||
|
@ -33,12 +33,12 @@ impl Command for Mv {
|
||||
.required(
|
||||
"source",
|
||||
SyntaxShape::GlobPattern,
|
||||
"the location to move files/directories from",
|
||||
"The location to move files/directories from.",
|
||||
)
|
||||
.required(
|
||||
"destination",
|
||||
SyntaxShape::Filepath,
|
||||
"the location to move files/directories to",
|
||||
"The location to move files/directories to.",
|
||||
)
|
||||
.switch(
|
||||
"verbose",
|
||||
|
@ -41,11 +41,11 @@ impl Command for Open {
|
||||
fn signature(&self) -> nu_protocol::Signature {
|
||||
Signature::build("open")
|
||||
.input_output_types(vec![(Type::Nothing, Type::Any), (Type::String, Type::Any)])
|
||||
.optional("filename", SyntaxShape::Filepath, "the filename to use")
|
||||
.optional("filename", SyntaxShape::Filepath, "The filename to use.")
|
||||
.rest(
|
||||
"filenames",
|
||||
SyntaxShape::Filepath,
|
||||
"optional additional files to open",
|
||||
"Optional additional files to open.",
|
||||
)
|
||||
.switch("raw", "open file as raw binary", Some('r'))
|
||||
.category(Category::FileSystem)
|
||||
|
@ -44,7 +44,7 @@ impl Command for Rm {
|
||||
.required(
|
||||
"filename",
|
||||
SyntaxShape::GlobPattern,
|
||||
"the file or files you want to remove",
|
||||
"The file or files you want to remove.",
|
||||
)
|
||||
.switch(
|
||||
"trash",
|
||||
@ -68,7 +68,7 @@ impl Command for Rm {
|
||||
.rest(
|
||||
"rest",
|
||||
SyntaxShape::GlobPattern,
|
||||
"additional file path(s) to remove",
|
||||
"Additional file path(s) to remove.",
|
||||
)
|
||||
.category(Category::FileSystem)
|
||||
}
|
||||
|
@ -42,7 +42,7 @@ impl Command for Save {
|
||||
fn signature(&self) -> nu_protocol::Signature {
|
||||
Signature::build("save")
|
||||
.input_output_types(vec![(Type::Any, Type::Nothing)])
|
||||
.required("filename", SyntaxShape::Filepath, "the filename to use")
|
||||
.required("filename", SyntaxShape::Filepath, "The filename to use.")
|
||||
.named(
|
||||
"stderr",
|
||||
SyntaxShape::Filepath,
|
||||
|
@ -30,7 +30,7 @@ impl Command for Start {
|
||||
fn signature(&self) -> nu_protocol::Signature {
|
||||
Signature::build("start")
|
||||
.input_output_types(vec![(Type::Nothing, Type::Any), (Type::String, Type::Any)])
|
||||
.required("path", SyntaxShape::String, "path to open")
|
||||
.required("path", SyntaxShape::String, "Path to open.")
|
||||
.category(Category::FileSystem)
|
||||
}
|
||||
|
||||
|
@ -29,7 +29,7 @@ impl Command for Touch {
|
||||
.required(
|
||||
"filename",
|
||||
SyntaxShape::Filepath,
|
||||
"the path of the file you want to create",
|
||||
"The path of the file you want to create.",
|
||||
)
|
||||
.named(
|
||||
"reference",
|
||||
@ -52,7 +52,7 @@ impl Command for Touch {
|
||||
"do not create the file if it does not exist",
|
||||
Some('c'),
|
||||
)
|
||||
.rest("rest", SyntaxShape::Filepath, "additional files to create")
|
||||
.rest("rest", SyntaxShape::Filepath, "Additional files to create.")
|
||||
.category(Category::FileSystem)
|
||||
}
|
||||
|
||||
|
@ -54,7 +54,7 @@ impl Command for UCp {
|
||||
.switch("progress", "display a progress bar", Some('p'))
|
||||
.switch("no-clobber", "do not overwrite an existing file", Some('n'))
|
||||
.switch("debug", "explain how a file is copied. Implies -v", None)
|
||||
.rest("paths", SyntaxShape::Filepath, "Copy SRC file/s to DEST")
|
||||
.rest("paths", SyntaxShape::Filepath, "Copy SRC file/s to DEST.")
|
||||
.allow_variants_without_examples(true)
|
||||
.category(Category::FileSystem)
|
||||
}
|
||||
|
@ -33,7 +33,7 @@ impl Command for UMkdir {
|
||||
.rest(
|
||||
"rest",
|
||||
SyntaxShape::Directory,
|
||||
"the name(s) of the path(s) to create",
|
||||
"The name(s) of the path(s) to create.",
|
||||
)
|
||||
.switch(
|
||||
"verbose",
|
||||
|
@ -40,10 +40,10 @@ impl Command for Watch {
|
||||
fn signature(&self) -> nu_protocol::Signature {
|
||||
Signature::build("watch")
|
||||
.input_output_types(vec![(Type::Nothing, Type::Table(vec![]))])
|
||||
.required("path", SyntaxShape::Filepath, "the path to watch. Can be a file or directory")
|
||||
.required("path", SyntaxShape::Filepath, "The path to watch. Can be a file or directory.")
|
||||
.required("closure",
|
||||
SyntaxShape::Closure(Some(vec![SyntaxShape::String, SyntaxShape::String, SyntaxShape::String])),
|
||||
"Some Nu code to run whenever a file changes. The closure will be passed `operation`, `path`, and `new_path` (for renames only) arguments in that order")
|
||||
"Some Nu code to run whenever a file changes. The closure will be passed `operation`, `path`, and `new_path` (for renames only) arguments in that order.")
|
||||
.named(
|
||||
"debounce-ms",
|
||||
SyntaxShape::Int,
|
||||
|
@ -23,7 +23,7 @@ impl Command for All {
|
||||
.required(
|
||||
"predicate",
|
||||
SyntaxShape::Closure(Some(vec![SyntaxShape::Any, SyntaxShape::Int])),
|
||||
"a closure that must evaluate to a boolean",
|
||||
"A closure that must evaluate to a boolean.",
|
||||
)
|
||||
.category(Category::Filters)
|
||||
}
|
||||
|
@ -23,7 +23,7 @@ impl Command for Any {
|
||||
.required(
|
||||
"predicate",
|
||||
SyntaxShape::Closure(Some(vec![SyntaxShape::Any, SyntaxShape::Int])),
|
||||
"a closure that must evaluate to a boolean",
|
||||
"A closure that must evaluate to a boolean.",
|
||||
)
|
||||
.category(Category::Filters)
|
||||
}
|
||||
|
@ -17,7 +17,11 @@ impl Command for Append {
|
||||
fn signature(&self) -> nu_protocol::Signature {
|
||||
Signature::build("append")
|
||||
.input_output_types(vec![(Type::Any, Type::List(Box::new(Type::Any)))])
|
||||
.required("row", SyntaxShape::Any, "the row, list, or table to append")
|
||||
.required(
|
||||
"row",
|
||||
SyntaxShape::Any,
|
||||
"The row, list, or table to append.",
|
||||
)
|
||||
.allow_variants_without_examples(true)
|
||||
.category(Category::Filters)
|
||||
}
|
||||
|
@ -35,7 +35,7 @@ impl Command for Compact {
|
||||
.rest(
|
||||
"columns",
|
||||
SyntaxShape::Any,
|
||||
"the columns to compact from the table",
|
||||
"The columns to compact from the table.",
|
||||
)
|
||||
.category(Category::Filters)
|
||||
}
|
||||
|
@ -22,9 +22,13 @@ impl Command for Default {
|
||||
.required(
|
||||
"default value",
|
||||
SyntaxShape::Any,
|
||||
"the value to use as a default",
|
||||
"The value to use as a default.",
|
||||
)
|
||||
.optional(
|
||||
"column name",
|
||||
SyntaxShape::String,
|
||||
"The name of the column.",
|
||||
)
|
||||
.optional("column name", SyntaxShape::String, "the name of the column")
|
||||
.category(Category::Filters)
|
||||
}
|
||||
|
||||
|
@ -25,7 +25,7 @@ impl Command for DropColumn {
|
||||
.optional(
|
||||
"columns",
|
||||
SyntaxShape::Int,
|
||||
"starting from the end, the number of columns to remove",
|
||||
"Starting from the end, the number of columns to remove.",
|
||||
)
|
||||
.category(Category::Filters)
|
||||
}
|
||||
|
@ -24,7 +24,7 @@ impl Command for Drop {
|
||||
Type::List(Box::new(Type::Any)),
|
||||
),
|
||||
])
|
||||
.optional("rows", SyntaxShape::Int, "The number of items to remove")
|
||||
.optional("rows", SyntaxShape::Int, "The number of items to remove.")
|
||||
.category(Category::Filters)
|
||||
}
|
||||
|
||||
|
@ -25,9 +25,9 @@ impl Command for DropNth {
|
||||
"row number or row range",
|
||||
// FIXME: we can make this accept either Int or Range when we can compose SyntaxShapes
|
||||
SyntaxShape::Any,
|
||||
"the number of the row to drop or a range to drop consecutive rows",
|
||||
"The number of the row to drop or a range to drop consecutive rows.",
|
||||
)
|
||||
.rest("rest", SyntaxShape::Any, "the number of the row to drop")
|
||||
.rest("rest", SyntaxShape::Any, "The number of the row to drop.")
|
||||
.category(Category::Filters)
|
||||
}
|
||||
|
||||
|
@ -46,7 +46,7 @@ with 'transpose' first."#
|
||||
.required(
|
||||
"closure",
|
||||
SyntaxShape::Closure(Some(vec![SyntaxShape::Any, SyntaxShape::Int])),
|
||||
"the closure to run",
|
||||
"The closure to run.",
|
||||
)
|
||||
.switch("keep-empty", "keep empty result cells", Some('k'))
|
||||
.allow_variants_without_examples(true)
|
||||
|
@ -20,7 +20,7 @@ impl Command for Empty {
|
||||
.rest(
|
||||
"rest",
|
||||
SyntaxShape::CellPath,
|
||||
"the names of the columns to check emptiness",
|
||||
"The names of the columns to check emptiness.",
|
||||
)
|
||||
.category(Category::Filters)
|
||||
}
|
||||
|
@ -24,7 +24,7 @@ impl Command for Every {
|
||||
.required(
|
||||
"stride",
|
||||
SyntaxShape::Int,
|
||||
"how many rows to skip between (and including) each row returned",
|
||||
"How many rows to skip between (and including) each row returned.",
|
||||
)
|
||||
.switch(
|
||||
"skip",
|
||||
|
@ -37,7 +37,7 @@ a variable. On the other hand, the "row condition" syntax is not supported."#
|
||||
.required(
|
||||
"closure",
|
||||
SyntaxShape::Closure(Some(vec![SyntaxShape::Any, SyntaxShape::Int])),
|
||||
"Predicate closure",
|
||||
"Predicate closure.",
|
||||
)
|
||||
.category(Category::Filters)
|
||||
}
|
||||
|
@ -64,7 +64,7 @@ impl Command for Find {
|
||||
Some('c'),
|
||||
)
|
||||
.switch("invert", "invert the match", Some('v'))
|
||||
.rest("rest", SyntaxShape::Any, "terms to search")
|
||||
.rest("rest", SyntaxShape::Any, "Terms to search.")
|
||||
.category(Category::Filters)
|
||||
}
|
||||
|
||||
|
@ -38,7 +38,7 @@ impl Command for First {
|
||||
.optional(
|
||||
"rows",
|
||||
SyntaxShape::Int,
|
||||
"starting from the front, the number of rows to return",
|
||||
"Starting from the front, the number of rows to return.",
|
||||
)
|
||||
.allow_variants_without_examples(true)
|
||||
.category(Category::Filters)
|
||||
|
@ -28,7 +28,7 @@ impl Command for Flatten {
|
||||
.rest(
|
||||
"rest",
|
||||
SyntaxShape::String,
|
||||
"optionally flatten data by column",
|
||||
"Optionally flatten data by column.",
|
||||
)
|
||||
.switch("all", "flatten inner table one level out", Some('a'))
|
||||
.category(Category::Filters)
|
||||
|
@ -39,9 +39,9 @@ If multiple cell paths are given, this will produce a list of values."#
|
||||
.required(
|
||||
"cell_path",
|
||||
SyntaxShape::CellPath,
|
||||
"the cell path to the data",
|
||||
"The cell path to the data.",
|
||||
)
|
||||
.rest("rest", SyntaxShape::CellPath, "additional cell paths")
|
||||
.rest("rest", SyntaxShape::CellPath, "Additional cell paths.")
|
||||
.switch(
|
||||
"ignore-errors",
|
||||
"ignore missing data (make all cell path members optional)",
|
||||
|
@ -24,7 +24,7 @@ impl Command for Group {
|
||||
Type::List(Box::new(Type::Any)),
|
||||
Type::List(Box::new(Type::List(Box::new(Type::Any)))),
|
||||
)])
|
||||
.required("group_size", SyntaxShape::Int, "the size of each group")
|
||||
.required("group_size", SyntaxShape::Int, "The size of each group.")
|
||||
.category(Category::Filters)
|
||||
}
|
||||
|
||||
|
@ -39,7 +39,7 @@ impl Command for GroupBy {
|
||||
SyntaxShape::Closure(None),
|
||||
SyntaxShape::Closure(Some(vec![SyntaxShape::Any])),
|
||||
]),
|
||||
"the path to the column to group on",
|
||||
"The path to the column to group on.",
|
||||
)
|
||||
.category(Category::Filters)
|
||||
}
|
||||
|
@ -27,12 +27,12 @@ impl Command for Insert {
|
||||
.required(
|
||||
"field",
|
||||
SyntaxShape::CellPath,
|
||||
"the name of the column to insert",
|
||||
"The name of the column to insert.",
|
||||
)
|
||||
.required(
|
||||
"new value",
|
||||
SyntaxShape::Any,
|
||||
"the new value to give the cell(s)",
|
||||
"The new value to give the cell(s).",
|
||||
)
|
||||
.allow_variants_without_examples(true)
|
||||
.category(Category::Filters)
|
||||
|
@ -22,7 +22,7 @@ impl Command for Items {
|
||||
.required(
|
||||
"closure",
|
||||
SyntaxShape::Closure(Some(vec![SyntaxShape::Any, SyntaxShape::Any])),
|
||||
"the closure to run",
|
||||
"The closure to run.",
|
||||
)
|
||||
.allow_variants_without_examples(true)
|
||||
.category(Category::Filters)
|
||||
|
@ -33,12 +33,12 @@ impl Command for Join {
|
||||
.required(
|
||||
"right-table",
|
||||
SyntaxShape::List(Box::new(SyntaxShape::Any)),
|
||||
"The right table in the join",
|
||||
"The right table in the join.",
|
||||
)
|
||||
.required(
|
||||
"left-on",
|
||||
SyntaxShape::String,
|
||||
"Name of column in input (left) table to join on",
|
||||
"Name of column in input (left) table to join on.",
|
||||
)
|
||||
.optional(
|
||||
"right-on",
|
||||
|
@ -31,7 +31,7 @@ impl Command for Last {
|
||||
.optional(
|
||||
"rows",
|
||||
SyntaxShape::Int,
|
||||
"starting from the back, the number of rows to return",
|
||||
"Starting from the back, the number of rows to return.",
|
||||
)
|
||||
.category(Category::Filters)
|
||||
}
|
||||
|
@ -36,7 +36,7 @@ repeating this process with row 1, and so on."#
|
||||
"value",
|
||||
// Both this and `update` should have a shape more like <record> | <table> than just <any>. -Leon 2022-10-27
|
||||
SyntaxShape::Any,
|
||||
"the new value to merge with",
|
||||
"The new value to merge with.",
|
||||
)
|
||||
.category(Category::Filters)
|
||||
}
|
||||
|
@ -30,7 +30,7 @@ impl Command for Move {
|
||||
(Type::Record(vec![]), Type::Record(vec![])),
|
||||
(Type::Table(vec![]), Type::Table(vec![])),
|
||||
])
|
||||
.rest("columns", SyntaxShape::String, "the columns to move")
|
||||
.rest("columns", SyntaxShape::String, "The columns to move.")
|
||||
.named(
|
||||
"after",
|
||||
SyntaxShape::String,
|
||||
|
@ -45,7 +45,7 @@ impl Command for ParEach {
|
||||
.required(
|
||||
"closure",
|
||||
SyntaxShape::Closure(Some(vec![SyntaxShape::Any, SyntaxShape::Int])),
|
||||
"the closure to run",
|
||||
"The closure to run.",
|
||||
)
|
||||
.allow_variants_without_examples(true)
|
||||
.category(Category::Filters)
|
||||
|
@ -20,7 +20,7 @@ impl Command for Prepend {
|
||||
.required(
|
||||
"row",
|
||||
SyntaxShape::Any,
|
||||
"the row, list, or table to prepend",
|
||||
"The row, list, or table to prepend.",
|
||||
)
|
||||
.category(Category::Filters)
|
||||
}
|
||||
|
@ -21,11 +21,7 @@ impl Command for Range {
|
||||
Type::List(Box::new(Type::Any)),
|
||||
Type::List(Box::new(Type::Any)),
|
||||
)])
|
||||
.required(
|
||||
"rows",
|
||||
SyntaxShape::Range,
|
||||
"range of rows to return: Eg) 4..7 (=> from 4 to 7)",
|
||||
)
|
||||
.required("rows", SyntaxShape::Range, "Range of rows to return.")
|
||||
.category(Category::Filters)
|
||||
}
|
||||
|
||||
|
@ -35,7 +35,7 @@ impl Command for Reduce {
|
||||
SyntaxShape::Any,
|
||||
SyntaxShape::Int,
|
||||
])),
|
||||
"reducing function",
|
||||
"Reducing function.",
|
||||
)
|
||||
.allow_variants_without_examples(true)
|
||||
.category(Category::Filters)
|
||||
|
@ -33,7 +33,7 @@ impl Command for Reject {
|
||||
SyntaxShape::CellPath,
|
||||
SyntaxShape::List(Box::new(SyntaxShape::CellPath)),
|
||||
]),
|
||||
"the names of columns to remove from the table",
|
||||
"The names of columns to remove from the table.",
|
||||
)
|
||||
.category(Category::Filters)
|
||||
}
|
||||
|
@ -34,7 +34,11 @@ impl Command for Rename {
|
||||
"A closure to apply changes on each column",
|
||||
Some('b'),
|
||||
)
|
||||
.rest("rest", SyntaxShape::String, "the new names for the columns")
|
||||
.rest(
|
||||
"rest",
|
||||
SyntaxShape::String,
|
||||
"The new names for the columns.",
|
||||
)
|
||||
.category(Category::Filters)
|
||||
}
|
||||
|
||||
|
@ -34,7 +34,7 @@ impl Command for Select {
|
||||
SyntaxShape::CellPath,
|
||||
SyntaxShape::List(Box::new(SyntaxShape::CellPath)),
|
||||
]),
|
||||
"the columns to select from the table",
|
||||
"The columns to select from the table.",
|
||||
)
|
||||
.allow_variants_without_examples(true)
|
||||
.category(Category::Filters)
|
||||
|
@ -25,7 +25,7 @@ impl Command for Skip {
|
||||
Type::List(Box::new(Type::Any)),
|
||||
),
|
||||
])
|
||||
.optional("n", SyntaxShape::Int, "the number of elements to skip")
|
||||
.optional("n", SyntaxShape::Int, "The number of elements to skip.")
|
||||
.category(Category::Filters)
|
||||
}
|
||||
|
||||
|
@ -26,7 +26,7 @@ impl Command for SkipUntil {
|
||||
.required(
|
||||
"predicate",
|
||||
SyntaxShape::Closure(Some(vec![SyntaxShape::Any, SyntaxShape::Int])),
|
||||
"the predicate that skipped element must not match",
|
||||
"The predicate that skipped element must not match.",
|
||||
)
|
||||
.category(Category::Filters)
|
||||
}
|
||||
|
@ -26,7 +26,7 @@ impl Command for SkipWhile {
|
||||
.required(
|
||||
"predicate",
|
||||
SyntaxShape::Closure(Some(vec![SyntaxShape::Any, SyntaxShape::Int])),
|
||||
"the predicate that skipped element must match",
|
||||
"The predicate that skipped element must match.",
|
||||
)
|
||||
.category(Category::Filters)
|
||||
}
|
||||
|
@ -24,7 +24,7 @@ impl Command for SortBy {
|
||||
(Type::Record(vec![]), Type::Table(vec![])),
|
||||
(Type::Table(vec![]), Type::Table(vec![])),
|
||||
])
|
||||
.rest("columns", SyntaxShape::Any, "the column(s) to sort by")
|
||||
.rest("columns", SyntaxShape::Any, "The column(s) to sort by.")
|
||||
.switch("reverse", "Sort in reverse order", Some('r'))
|
||||
.switch(
|
||||
"ignore-case",
|
||||
|
@ -18,7 +18,7 @@ impl Command for SplitBy {
|
||||
fn signature(&self) -> Signature {
|
||||
Signature::build("split-by")
|
||||
.input_output_types(vec![(Type::Record(vec![]), Type::Record(vec![]))])
|
||||
.optional("splitter", SyntaxShape::Any, "the splitter value to use")
|
||||
.optional("splitter", SyntaxShape::Any, "The splitter value to use.")
|
||||
.category(Category::Filters)
|
||||
}
|
||||
|
||||
|
@ -28,7 +28,7 @@ impl Command for Take {
|
||||
.required(
|
||||
"n",
|
||||
SyntaxShape::Int,
|
||||
"starting from the front, the number of elements to return",
|
||||
"Starting from the front, the number of elements to return.",
|
||||
)
|
||||
.category(Category::Filters)
|
||||
}
|
||||
|
@ -26,7 +26,7 @@ impl Command for TakeUntil {
|
||||
.required(
|
||||
"predicate",
|
||||
SyntaxShape::Closure(Some(vec![SyntaxShape::Any, SyntaxShape::Int])),
|
||||
"the predicate that element(s) must not match",
|
||||
"The predicate that element(s) must not match.",
|
||||
)
|
||||
.category(Category::Filters)
|
||||
}
|
||||
|
@ -26,7 +26,7 @@ impl Command for TakeWhile {
|
||||
.required(
|
||||
"predicate",
|
||||
SyntaxShape::Closure(Some(vec![SyntaxShape::Any, SyntaxShape::Int])),
|
||||
"the predicate that element(s) must match",
|
||||
"The predicate that element(s) must match.",
|
||||
)
|
||||
.category(Category::Filters)
|
||||
}
|
||||
|
@ -59,7 +59,7 @@ impl Command for Transpose {
|
||||
.rest(
|
||||
"rest",
|
||||
SyntaxShape::String,
|
||||
"the names to give columns once transposed",
|
||||
"The names to give columns once transposed.",
|
||||
)
|
||||
.category(Category::Filters)
|
||||
}
|
||||
|
@ -24,7 +24,7 @@ impl Command for UniqBy {
|
||||
Type::List(Box::new(Type::Any)),
|
||||
),
|
||||
])
|
||||
.rest("columns", SyntaxShape::Any, "the column(s) to filter by")
|
||||
.rest("columns", SyntaxShape::Any, "The column(s) to filter by.")
|
||||
.switch(
|
||||
"count",
|
||||
"Return a table containing the distinct input values together with their counts",
|
||||
|
@ -27,12 +27,12 @@ impl Command for Update {
|
||||
.required(
|
||||
"field",
|
||||
SyntaxShape::CellPath,
|
||||
"the name of the column to update",
|
||||
"The name of the column to update.",
|
||||
)
|
||||
.required(
|
||||
"replacement value",
|
||||
SyntaxShape::Any,
|
||||
"the new value to give the cell(s), or a closure to create the value",
|
||||
"The new value to give the cell(s), or a closure to create the value.",
|
||||
)
|
||||
.allow_variants_without_examples(true)
|
||||
.category(Category::Filters)
|
||||
|
@ -27,12 +27,12 @@ impl Command for Upsert {
|
||||
.required(
|
||||
"field",
|
||||
SyntaxShape::CellPath,
|
||||
"the name of the column to update or insert",
|
||||
"The name of the column to update or insert.",
|
||||
)
|
||||
.required(
|
||||
"replacement value",
|
||||
SyntaxShape::Any,
|
||||
"the new value to give the cell(s), or a closure to create the value",
|
||||
"The new value to give the cell(s), or a closure to create the value.",
|
||||
)
|
||||
.allow_variants_without_examples(true)
|
||||
.category(Category::Filters)
|
||||
|
@ -37,7 +37,7 @@ not supported."#
|
||||
.required(
|
||||
"row_condition",
|
||||
SyntaxShape::RowCondition,
|
||||
"Filter condition",
|
||||
"Filter condition.",
|
||||
)
|
||||
.allow_variants_without_examples(true)
|
||||
.category(Category::Filters)
|
||||
|
@ -20,7 +20,7 @@ impl Command for Window {
|
||||
Type::List(Box::new(Type::Any)),
|
||||
Type::List(Box::new(Type::List(Box::new(Type::Any)))),
|
||||
)])
|
||||
.required("window_size", SyntaxShape::Int, "the size of each window")
|
||||
.required("window_size", SyntaxShape::Int, "The size of each window.")
|
||||
.named(
|
||||
"stride",
|
||||
SyntaxShape::Int,
|
||||
|
@ -25,7 +25,7 @@ impl Command for Wrap {
|
||||
(Type::Range, Type::Table(vec![])),
|
||||
(Type::Any, Type::Record(vec![])),
|
||||
])
|
||||
.required("name", SyntaxShape::String, "the name of the column")
|
||||
.required("name", SyntaxShape::String, "The name of the column.")
|
||||
.allow_variants_without_examples(true)
|
||||
.category(Category::Filters)
|
||||
}
|
||||
|
@ -30,7 +30,7 @@ impl Command for Zip {
|
||||
Type::List(Box::new(Type::List(Box::new(Type::Any)))),
|
||||
),
|
||||
])
|
||||
.required("other", SyntaxShape::Any, "the other input")
|
||||
.required("other", SyntaxShape::Any, "The other input.")
|
||||
.category(Category::Filters)
|
||||
}
|
||||
|
||||
|
@ -24,11 +24,11 @@ impl Command for Generate {
|
||||
Type::List(Box::new(Type::Any)),
|
||||
),
|
||||
])
|
||||
.required("initial", SyntaxShape::Any, "initial value")
|
||||
.required("initial", SyntaxShape::Any, "Initial value.")
|
||||
.required(
|
||||
"closure",
|
||||
SyntaxShape::Closure(Some(vec![SyntaxShape::Any])),
|
||||
"generator function",
|
||||
"Generator function.",
|
||||
)
|
||||
.allow_variants_without_examples(true)
|
||||
.category(Category::Generators)
|
||||
|
@ -17,7 +17,7 @@ impl Command for Seq {
|
||||
fn signature(&self) -> Signature {
|
||||
Signature::build("seq")
|
||||
.input_output_types(vec![(Type::Nothing, Type::List(Box::new(Type::Number)))])
|
||||
.rest("rest", SyntaxShape::Number, "sequence values")
|
||||
.rest("rest", SyntaxShape::Number, "Sequence values.")
|
||||
.category(Category::Generators)
|
||||
}
|
||||
|
||||
|
@ -23,12 +23,12 @@ impl Command for SeqChar {
|
||||
.required(
|
||||
"start",
|
||||
SyntaxShape::String,
|
||||
"start of character sequence (inclusive)",
|
||||
"Start of character sequence (inclusive).",
|
||||
)
|
||||
.required(
|
||||
"end",
|
||||
SyntaxShape::String,
|
||||
"end of character sequence (inclusive)",
|
||||
"End of character sequence (inclusive).",
|
||||
)
|
||||
.category(Category::Generators)
|
||||
}
|
||||
|
@ -68,7 +68,7 @@ where
|
||||
.rest(
|
||||
"rest",
|
||||
SyntaxShape::CellPath,
|
||||
format!("optionally {} hash data by cell path", D::name()),
|
||||
format!("Optionally {} hash data by cell path.", D::name()),
|
||||
)
|
||||
}
|
||||
|
||||
|
@ -28,7 +28,7 @@ impl Command for Help {
|
||||
.rest(
|
||||
"rest",
|
||||
SyntaxShape::String,
|
||||
"the name of command, alias or module to get help on",
|
||||
"The name of command, alias or module to get help on.",
|
||||
)
|
||||
.named(
|
||||
"find",
|
||||
|
@ -26,7 +26,7 @@ impl Command for HelpAliases {
|
||||
.rest(
|
||||
"rest",
|
||||
SyntaxShape::String,
|
||||
"the name of alias to get help on",
|
||||
"The name of alias to get help on.",
|
||||
)
|
||||
.named(
|
||||
"find",
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user