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:
Eric Hodel 2023-12-14 22:32:37 -08:00 committed by GitHub
parent c2b684464f
commit 5b01685fc3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
196 changed files with 383 additions and 281 deletions

View file

@ -19,11 +19,11 @@ impl Command for Alias {
fn signature(&self) -> nu_protocol::Signature { fn signature(&self) -> nu_protocol::Signature {
Signature::build("alias") Signature::build("alias")
.input_output_types(vec![(Type::Nothing, Type::Nothing)]) .input_output_types(vec![(Type::Nothing, Type::Nothing)])
.required("name", SyntaxShape::String, "name of the alias") .required("name", SyntaxShape::String, "Name of the alias.")
.required( .required(
"initial_value", "initial_value",
SyntaxShape::Keyword(b"=".to_vec(), Box::new(SyntaxShape::Expression)), SyntaxShape::Keyword(b"=".to_vec(), Box::new(SyntaxShape::Expression)),
"equals sign followed by value", "Equals sign followed by value.",
) )
.category(Category::Core) .category(Category::Core)
} }

View file

@ -20,7 +20,7 @@ impl Command for Collect {
.required( .required(
"closure", "closure",
SyntaxShape::Closure(Some(vec![SyntaxShape::Any])), SyntaxShape::Closure(Some(vec![SyntaxShape::Any])),
"the closure to run once the stream is collected", "The closure to run once the stream is collected.",
) )
.switch( .switch(
"keep-env", "keep-env",

View file

@ -18,11 +18,11 @@ impl Command for Const {
Signature::build("const") Signature::build("const")
.input_output_types(vec![(Type::Nothing, Type::Nothing)]) .input_output_types(vec![(Type::Nothing, Type::Nothing)])
.allow_variants_without_examples(true) .allow_variants_without_examples(true)
.required("const_name", SyntaxShape::VarWithOptType, "constant name") .required("const_name", SyntaxShape::VarWithOptType, "Constant name.")
.required( .required(
"initial_value", "initial_value",
SyntaxShape::Keyword(b"=".to_vec(), Box::new(SyntaxShape::MathExpression)), SyntaxShape::Keyword(b"=".to_vec(), Box::new(SyntaxShape::MathExpression)),
"equals sign followed by constant value", "Equals sign followed by constant value.",
) )
.category(Category::Core) .category(Category::Core)
} }

View file

@ -19,9 +19,9 @@ impl Command for Def {
fn signature(&self) -> nu_protocol::Signature { fn signature(&self) -> nu_protocol::Signature {
Signature::build("def") Signature::build("def")
.input_output_types(vec![(Type::Nothing, Type::Nothing)]) .input_output_types(vec![(Type::Nothing, Type::Nothing)])
.required("def_name", SyntaxShape::String, "command name") .required("def_name", SyntaxShape::String, "Command name.")
.required("params", SyntaxShape::Signature, "parameters") .required("params", SyntaxShape::Signature, "Parameters.")
.required("block", SyntaxShape::Closure(None), "body of the definition") .required("block", SyntaxShape::Closure(None), "Body of the definition.")
.switch("env", "keep the environment defined inside the command", None) .switch("env", "keep the environment defined inside the command", None)
.switch("wrapped", "treat unknown flags and arguments as strings (requires ...rest-like parameter in signature)", None) .switch("wrapped", "treat unknown flags and arguments as strings (requires ...rest-like parameter in signature)", None)
.category(Category::Core) .category(Category::Core)

View file

@ -25,7 +25,7 @@ impl Command for Do {
.required( .required(
"closure", "closure",
SyntaxShape::OneOf(vec![SyntaxShape::Closure(None), SyntaxShape::Any]), SyntaxShape::OneOf(vec![SyntaxShape::Closure(None), SyntaxShape::Any]),
"the closure to run", "The closure to run.",
) )
.input_output_types(vec![(Type::Any, Type::Any)]) .input_output_types(vec![(Type::Any, Type::Any)])
.switch( .switch(
@ -53,7 +53,11 @@ impl Command for Do {
"keep the environment defined inside the command", "keep the environment defined inside the command",
None, None,
) )
.rest("rest", SyntaxShape::Any, "the parameter(s) for the closure") .rest(
"rest",
SyntaxShape::Any,
"The parameter(s) for the closure.",
)
.category(Category::Core) .category(Category::Core)
} }

View file

@ -21,7 +21,7 @@ impl Command for Echo {
fn signature(&self) -> Signature { fn signature(&self) -> Signature {
Signature::build("echo") Signature::build("echo")
.input_output_types(vec![(Type::Nothing, Type::Any)]) .input_output_types(vec![(Type::Nothing, Type::Any)])
.rest("rest", SyntaxShape::Any, "the values to echo") .rest("rest", SyntaxShape::Any, "The values to echo.")
.category(Category::Core) .category(Category::Core)
} }

View file

@ -19,7 +19,7 @@ impl Command for ErrorMake {
.required( .required(
"error_struct", "error_struct",
SyntaxShape::Record(vec![]), SyntaxShape::Record(vec![]),
"the error to create", "The error to create.",
) )
.switch( .switch(
"unspanned", "unspanned",

View file

@ -19,11 +19,11 @@ impl Command for ExportAlias {
fn signature(&self) -> nu_protocol::Signature { fn signature(&self) -> nu_protocol::Signature {
Signature::build("export alias") Signature::build("export alias")
.input_output_types(vec![(Type::Nothing, Type::Nothing)]) .input_output_types(vec![(Type::Nothing, Type::Nothing)])
.required("name", SyntaxShape::String, "name of the alias") .required("name", SyntaxShape::String, "Name of the alias.")
.required( .required(
"initial_value", "initial_value",
SyntaxShape::Keyword(b"=".to_vec(), Box::new(SyntaxShape::Expression)), SyntaxShape::Keyword(b"=".to_vec(), Box::new(SyntaxShape::Expression)),
"equals sign followed by value", "Equals sign followed by value.",
) )
.category(Category::Core) .category(Category::Core)
} }

View file

@ -20,11 +20,11 @@ impl Command for ExportConst {
Signature::build("export const") Signature::build("export const")
.input_output_types(vec![(Type::Nothing, Type::Nothing)]) .input_output_types(vec![(Type::Nothing, Type::Nothing)])
.allow_variants_without_examples(true) .allow_variants_without_examples(true)
.required("const_name", SyntaxShape::VarWithOptType, "constant name") .required("const_name", SyntaxShape::VarWithOptType, "Constant name.")
.required( .required(
"initial_value", "initial_value",
SyntaxShape::Keyword(b"=".to_vec(), Box::new(SyntaxShape::MathExpression)), SyntaxShape::Keyword(b"=".to_vec(), Box::new(SyntaxShape::MathExpression)),
"equals sign followed by constant value", "Equals sign followed by constant value.",
) )
.category(Category::Core) .category(Category::Core)
} }

View file

@ -19,9 +19,9 @@ impl Command for ExportDef {
fn signature(&self) -> nu_protocol::Signature { fn signature(&self) -> nu_protocol::Signature {
Signature::build("export def") Signature::build("export def")
.input_output_types(vec![(Type::Nothing, Type::Nothing)]) .input_output_types(vec![(Type::Nothing, Type::Nothing)])
.required("def_name", SyntaxShape::String, "command name") .required("def_name", SyntaxShape::String, "Command name.")
.required("params", SyntaxShape::Signature, "parameters") .required("params", SyntaxShape::Signature, "Parameters.")
.required("block", SyntaxShape::Block, "body of the definition") .required("block", SyntaxShape::Block, "Body of the definition.")
.switch("env", "keep the environment defined inside the command", None) .switch("env", "keep the environment defined inside the command", None)
.switch("wrapped", "treat unknown flags and arguments as strings (requires ...rest-like parameter in signature)", None) .switch("wrapped", "treat unknown flags and arguments as strings (requires ...rest-like parameter in signature)", None)
.category(Category::Core) .category(Category::Core)

View file

@ -17,8 +17,8 @@ impl Command for ExportExtern {
fn signature(&self) -> nu_protocol::Signature { fn signature(&self) -> nu_protocol::Signature {
Signature::build("export extern") Signature::build("export extern")
.input_output_types(vec![(Type::Nothing, Type::Nothing)]) .input_output_types(vec![(Type::Nothing, Type::Nothing)])
.required("def_name", SyntaxShape::String, "definition name") .required("def_name", SyntaxShape::String, "Definition name.")
.required("params", SyntaxShape::Signature, "parameters") .required("params", SyntaxShape::Signature, "Parameters.")
.category(Category::Core) .category(Category::Core)
} }

View file

@ -20,11 +20,11 @@ impl Command for ExportModule {
Signature::build("export module") Signature::build("export module")
.input_output_types(vec![(Type::Nothing, Type::Nothing)]) .input_output_types(vec![(Type::Nothing, Type::Nothing)])
.allow_variants_without_examples(true) .allow_variants_without_examples(true)
.required("module", SyntaxShape::String, "module name or module path") .required("module", SyntaxShape::String, "Module name or module path.")
.optional( .optional(
"block", "block",
SyntaxShape::Block, SyntaxShape::Block,
"body of the module if 'module' parameter is not a path", "Body of the module if 'module' parameter is not a path.",
) )
.category(Category::Core) .category(Category::Core)
} }

View file

@ -19,11 +19,11 @@ impl Command for ExportUse {
fn signature(&self) -> nu_protocol::Signature { fn signature(&self) -> nu_protocol::Signature {
Signature::build("export use") Signature::build("export use")
.input_output_types(vec![(Type::Nothing, Type::Nothing)]) .input_output_types(vec![(Type::Nothing, Type::Nothing)])
.required("module", SyntaxShape::String, "Module or module file") .required("module", SyntaxShape::String, "Module or module file.")
.optional( .optional(
"members", "members",
SyntaxShape::Any, SyntaxShape::Any,
"Which members of the module to import", "Which members of the module to import.",
) )
.category(Category::Core) .category(Category::Core)
} }

View file

@ -17,8 +17,8 @@ impl Command for Extern {
fn signature(&self) -> nu_protocol::Signature { fn signature(&self) -> nu_protocol::Signature {
Signature::build("extern") Signature::build("extern")
.input_output_types(vec![(Type::Nothing, Type::Nothing)]) .input_output_types(vec![(Type::Nothing, Type::Nothing)])
.required("def_name", SyntaxShape::String, "definition name") .required("def_name", SyntaxShape::String, "Definition name.")
.required("params", SyntaxShape::Signature, "parameters") .required("params", SyntaxShape::Signature, "Parameters.")
.category(Category::Core) .category(Category::Core)
} }

View file

@ -25,14 +25,14 @@ impl Command for For {
.required( .required(
"var_name", "var_name",
SyntaxShape::VarWithOptType, SyntaxShape::VarWithOptType,
"name of the looping variable", "Name of the looping variable.",
) )
.required( .required(
"range", "range",
SyntaxShape::Keyword(b"in".to_vec(), Box::new(SyntaxShape::Any)), SyntaxShape::Keyword(b"in".to_vec(), Box::new(SyntaxShape::Any)),
"range of the loop", "Range of the loop.",
) )
.required("block", SyntaxShape::Block, "the block to run") .required("block", SyntaxShape::Block, "The block to run.")
.switch( .switch(
"numbered", "numbered",
"return a numbered item ($it.index and $it.item)", "return a numbered item ($it.index and $it.item)",

View file

@ -13,11 +13,11 @@ impl Command for Hide {
fn signature(&self) -> nu_protocol::Signature { fn signature(&self) -> nu_protocol::Signature {
Signature::build("hide") Signature::build("hide")
.input_output_types(vec![(Type::Nothing, Type::Nothing)]) .input_output_types(vec![(Type::Nothing, Type::Nothing)])
.required("module", SyntaxShape::String, "Module or module file") .required("module", SyntaxShape::String, "Module or module file.")
.optional( .optional(
"members", "members",
SyntaxShape::Any, SyntaxShape::Any,
"Which members of the module to import", "Which members of the module to import.",
) )
.category(Category::Core) .category(Category::Core)
} }

View file

@ -20,7 +20,7 @@ impl Command for HideEnv {
.rest( .rest(
"name", "name",
SyntaxShape::String, SyntaxShape::String,
"environment variable names to hide", "Environment variable names to hide.",
) )
.switch( .switch(
"ignore-errors", "ignore-errors",

View file

@ -21,11 +21,11 @@ impl Command for If {
fn signature(&self) -> nu_protocol::Signature { fn signature(&self) -> nu_protocol::Signature {
Signature::build("if") Signature::build("if")
.input_output_types(vec![(Type::Any, Type::Any)]) .input_output_types(vec![(Type::Any, Type::Any)])
.required("cond", SyntaxShape::MathExpression, "condition to check") .required("cond", SyntaxShape::MathExpression, "Condition to check.")
.required( .required(
"then_block", "then_block",
SyntaxShape::Block, SyntaxShape::Block,
"block to run if check succeeds", "Block to run if check succeeds.",
) )
.optional( .optional(
"else_expression", "else_expression",
@ -36,7 +36,7 @@ impl Command for If {
SyntaxShape::Expression, SyntaxShape::Expression,
])), ])),
), ),
"expression or block to run if check fails", "Expression or block to run when the condition is false.",
) )
.category(Category::Core) .category(Category::Core)
} }

View file

@ -19,11 +19,11 @@ impl Command for Let {
Signature::build("let") Signature::build("let")
.input_output_types(vec![(Type::Any, Type::Nothing)]) .input_output_types(vec![(Type::Any, Type::Nothing)])
.allow_variants_without_examples(true) .allow_variants_without_examples(true)
.required("var_name", SyntaxShape::VarWithOptType, "variable name") .required("var_name", SyntaxShape::VarWithOptType, "Variable name.")
.required( .required(
"initial_value", "initial_value",
SyntaxShape::Keyword(b"=".to_vec(), Box::new(SyntaxShape::MathExpression)), SyntaxShape::Keyword(b"=".to_vec(), Box::new(SyntaxShape::MathExpression)),
"equals sign followed by value", "Equals sign followed by value.",
) )
.category(Category::Core) .category(Category::Core)
} }

View file

@ -21,7 +21,7 @@ impl Command for Loop {
Signature::build("loop") Signature::build("loop")
.input_output_types(vec![(Type::Nothing, Type::Nothing)]) .input_output_types(vec![(Type::Nothing, Type::Nothing)])
.allow_variants_without_examples(true) .allow_variants_without_examples(true)
.required("block", SyntaxShape::Block, "block to loop") .required("block", SyntaxShape::Block, "Block to loop.")
.category(Category::Core) .category(Category::Core)
} }

View file

@ -20,11 +20,11 @@ impl Command for Match {
fn signature(&self) -> nu_protocol::Signature { fn signature(&self) -> nu_protocol::Signature {
Signature::build("match") Signature::build("match")
.input_output_types(vec![(Type::Any, Type::Any)]) .input_output_types(vec![(Type::Any, Type::Any)])
.required("value", SyntaxShape::Any, "value to check") .required("value", SyntaxShape::Any, "Value to check.")
.required( .required(
"match_block", "match_block",
SyntaxShape::MatchBlock, SyntaxShape::MatchBlock,
"block to run if check succeeds", "Block to run if check succeeds.",
) )
.category(Category::Core) .category(Category::Core)
} }

View file

@ -20,11 +20,11 @@ impl Command for Module {
Signature::build("module") Signature::build("module")
.input_output_types(vec![(Type::Nothing, Type::Nothing)]) .input_output_types(vec![(Type::Nothing, Type::Nothing)])
.allow_variants_without_examples(true) .allow_variants_without_examples(true)
.required("module", SyntaxShape::String, "module name or module path") .required("module", SyntaxShape::String, "Module name or module path.")
.optional( .optional(
"block", "block",
SyntaxShape::Block, SyntaxShape::Block,
"body of the module if 'module' parameter is not a module path", "Body of the module if 'module' parameter is not a module path.",
) )
.category(Category::Core) .category(Category::Core)
} }

View file

@ -19,11 +19,11 @@ impl Command for Mut {
Signature::build("mut") Signature::build("mut")
.input_output_types(vec![(Type::Any, Type::Nothing)]) .input_output_types(vec![(Type::Any, Type::Nothing)])
.allow_variants_without_examples(true) .allow_variants_without_examples(true)
.required("var_name", SyntaxShape::VarWithOptType, "variable name") .required("var_name", SyntaxShape::VarWithOptType, "Variable name.")
.required( .required(
"initial_value", "initial_value",
SyntaxShape::Keyword(b"=".to_vec(), Box::new(SyntaxShape::MathExpression)), SyntaxShape::Keyword(b"=".to_vec(), Box::new(SyntaxShape::MathExpression)),
"equals sign followed by value", "Equals sign followed by value.",
) )
.category(Category::Core) .category(Category::Core)
} }

View file

@ -20,10 +20,10 @@ impl Command for OverlayHide {
fn signature(&self) -> nu_protocol::Signature { fn signature(&self) -> nu_protocol::Signature {
Signature::build("overlay hide") Signature::build("overlay hide")
.input_output_types(vec![(Type::Nothing, Type::Nothing)]) .input_output_types(vec![(Type::Nothing, Type::Nothing)])
.optional("name", SyntaxShape::String, "Overlay to hide") .optional("name", SyntaxShape::String, "Overlay to hide.")
.switch( .switch(
"keep-custom", "keep-custom",
"Keep all newly added commands and aliases in the next activated overlay", "Keep all newly added commands and aliases in the next activated overlay.",
Some('k'), Some('k'),
) )
.named( .named(

View file

@ -21,7 +21,7 @@ impl Command for OverlayNew {
Signature::build("overlay new") Signature::build("overlay new")
.input_output_types(vec![(Type::Nothing, Type::Nothing)]) .input_output_types(vec![(Type::Nothing, Type::Nothing)])
.allow_variants_without_examples(true) .allow_variants_without_examples(true)
.required("name", SyntaxShape::String, "Name of the overlay") .required("name", SyntaxShape::String, "Name of the overlay.")
// TODO: // TODO:
// .switch( // .switch(
// "prefix", // "prefix",

View file

@ -27,12 +27,12 @@ impl Command for OverlayUse {
.required( .required(
"name", "name",
SyntaxShape::String, SyntaxShape::String,
"Module name to use overlay for", "Module name to use overlay for.",
) )
.optional( .optional(
"as", "as",
SyntaxShape::Keyword(b"as".to_vec(), Box::new(SyntaxShape::String)), SyntaxShape::Keyword(b"as".to_vec(), Box::new(SyntaxShape::String)),
"as keyword followed by a new name", "`as` keyword followed by a new name.",
) )
.switch( .switch(
"prefix", "prefix",

View file

@ -20,12 +20,12 @@ impl Command for Register {
.required( .required(
"plugin", "plugin",
SyntaxShape::Filepath, SyntaxShape::Filepath,
"path of executable for plugin", "Path of executable for plugin.",
) )
.optional( .optional(
"signature", "signature",
SyntaxShape::Any, SyntaxShape::Any,
"Block with signature description as json object", "Block with signature description as json object.",
) )
.named( .named(
"shell", "shell",

View file

@ -20,7 +20,11 @@ impl Command for Return {
fn signature(&self) -> nu_protocol::Signature { fn signature(&self) -> nu_protocol::Signature {
Signature::build("return") Signature::build("return")
.input_output_types(vec![(Type::Nothing, Type::Any)]) .input_output_types(vec![(Type::Nothing, Type::Any)])
.optional("return_value", SyntaxShape::Any, "optional value to return") .optional(
"return_value",
SyntaxShape::Any,
"Optional value to return.",
)
.category(Category::Core) .category(Category::Core)
} }

View file

@ -21,7 +21,7 @@ impl Command for Try {
fn signature(&self) -> nu_protocol::Signature { fn signature(&self) -> nu_protocol::Signature {
Signature::build("try") Signature::build("try")
.input_output_types(vec![(Type::Any, Type::Any)]) .input_output_types(vec![(Type::Any, Type::Any)])
.required("try_block", SyntaxShape::Block, "block to run") .required("try_block", SyntaxShape::Block, "Block to run.")
.optional( .optional(
"catch_block", "catch_block",
SyntaxShape::Keyword( SyntaxShape::Keyword(
@ -31,7 +31,7 @@ impl Command for Try {
SyntaxShape::Closure(Some(vec![SyntaxShape::Any])), SyntaxShape::Closure(Some(vec![SyntaxShape::Any])),
])), ])),
), ),
"block to run if try block fails", "Block to run if try block fails.",
) )
.category(Category::Core) .category(Category::Core)
} }

View file

@ -21,11 +21,11 @@ impl Command for Use {
Signature::build("use") Signature::build("use")
.input_output_types(vec![(Type::Nothing, Type::Nothing)]) .input_output_types(vec![(Type::Nothing, Type::Nothing)])
.allow_variants_without_examples(true) .allow_variants_without_examples(true)
.required("module", SyntaxShape::String, "Module or module file") .required("module", SyntaxShape::String, "Module or module file.")
.rest( .rest(
"members", "members",
SyntaxShape::Any, SyntaxShape::Any,
"Which members of the module to import", "Which members of the module to import.",
) )
.category(Category::Core) .category(Category::Core)
} }

View file

@ -21,11 +21,11 @@ impl Command for While {
Signature::build("while") Signature::build("while")
.input_output_types(vec![(Type::Nothing, Type::Nothing)]) .input_output_types(vec![(Type::Nothing, Type::Nothing)])
.allow_variants_without_examples(true) .allow_variants_without_examples(true)
.required("cond", SyntaxShape::MathExpression, "condition to check") .required("cond", SyntaxShape::MathExpression, "Condition to check.")
.required( .required(
"block", "block",
SyntaxShape::Block, SyntaxShape::Block,
"block to loop if check succeeds", "Block to loop if check succeeds.",
) )
.category(Category::Core) .category(Category::Core)
} }

View file

@ -40,7 +40,7 @@ impl Command for BytesAdd {
(Type::Record(vec![]), Type::Record(vec![])), (Type::Record(vec![]), Type::Record(vec![])),
]) ])
.allow_variants_without_examples(true) .allow_variants_without_examples(true)
.required("data", SyntaxShape::Binary, "the binary to add") .required("data", SyntaxShape::Binary, "The binary to add.")
.named( .named(
"index", "index",
SyntaxShape::Int, SyntaxShape::Int,
@ -51,7 +51,7 @@ impl Command for BytesAdd {
.rest( .rest(
"rest", "rest",
SyntaxShape::CellPath, 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) .category(Category::Bytes)
} }

View file

@ -47,11 +47,11 @@ impl Command for BytesAt {
(Type::Table(vec![]), Type::Table(vec![])), (Type::Table(vec![]), Type::Table(vec![])),
(Type::Record(vec![]), Type::Record(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(
"rest", "rest",
SyntaxShape::CellPath, 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) .category(Category::Bytes)
} }

View file

@ -25,7 +25,7 @@ impl Command for BytesBuild {
fn signature(&self) -> nu_protocol::Signature { fn signature(&self) -> nu_protocol::Signature {
Signature::build("bytes build") Signature::build("bytes build")
.input_output_types(vec![(Type::Nothing, Type::Binary)]) .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) .category(Category::Bytes)
} }

View file

@ -20,7 +20,7 @@ impl Command for BytesCollect {
.optional( .optional(
"separator", "separator",
SyntaxShape::Binary, SyntaxShape::Binary,
"optional separator to use when creating binary", "Optional separator to use when creating binary.",
) )
.category(Category::Bytes) .category(Category::Bytes)
} }

View file

@ -33,11 +33,11 @@ impl Command for BytesEndsWith {
(Type::Record(vec![]), Type::Record(vec![])), (Type::Record(vec![]), Type::Record(vec![])),
]) ])
.allow_variants_without_examples(true) .allow_variants_without_examples(true)
.required("pattern", SyntaxShape::Binary, "the pattern to match") .required("pattern", SyntaxShape::Binary, "The pattern to match.")
.rest( .rest(
"rest", "rest",
SyntaxShape::CellPath, 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) .category(Category::Bytes)
} }

View file

@ -41,12 +41,12 @@ impl Command for BytesIndexOf {
.required( .required(
"pattern", "pattern",
SyntaxShape::Binary, SyntaxShape::Binary,
"the pattern to find index of", "The pattern to find index of.",
) )
.rest( .rest(
"rest", "rest",
SyntaxShape::CellPath, 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("all", "returns all matched index", Some('a'))
.switch("end", "search from the end of the binary", Some('e')) .switch("end", "search from the end of the binary", Some('e'))

View file

@ -29,7 +29,7 @@ impl Command for BytesLen {
.rest( .rest(
"rest", "rest",
SyntaxShape::CellPath, 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) .category(Category::Bytes)
} }

View file

@ -35,11 +35,11 @@ impl Command for BytesRemove {
(Type::Table(vec![]), Type::Table(vec![])), (Type::Table(vec![]), Type::Table(vec![])),
(Type::Record(vec![]), Type::Record(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(
"rest", "rest",
SyntaxShape::CellPath, 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("end", "remove from end of binary", Some('e'))
.switch("all", "remove occurrences of finding binary", Some('a')) .switch("all", "remove occurrences of finding binary", Some('a'))

View file

@ -36,12 +36,12 @@ impl Command for BytesReplace {
(Type::Record(vec![]), Type::Record(vec![])), (Type::Record(vec![]), Type::Record(vec![])),
]) ])
.allow_variants_without_examples(true) .allow_variants_without_examples(true)
.required("find", SyntaxShape::Binary, "the pattern to find") .required("find", SyntaxShape::Binary, "The pattern to find.")
.required("replace", SyntaxShape::Binary, "the replacement pattern") .required("replace", SyntaxShape::Binary, "The replacement pattern.")
.rest( .rest(
"rest", "rest",
SyntaxShape::CellPath, 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')) .switch("all", "replace all occurrences of find binary", Some('a'))
.category(Category::Bytes) .category(Category::Bytes)

View file

@ -26,7 +26,7 @@ impl Command for BytesReverse {
.rest( .rest(
"rest", "rest",
SyntaxShape::CellPath, 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) .category(Category::Bytes)
} }

View file

@ -35,11 +35,11 @@ impl Command for BytesStartsWith {
(Type::Record(vec![]), Type::Record(vec![])), (Type::Record(vec![]), Type::Record(vec![])),
]) ])
.allow_variants_without_examples(true) .allow_variants_without_examples(true)
.required("pattern", SyntaxShape::Binary, "the pattern to match") .required("pattern", SyntaxShape::Binary, "The pattern to match.")
.rest( .rest(
"rest", "rest",
SyntaxShape::CellPath, 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) .category(Category::Bytes)
} }

View file

@ -25,8 +25,8 @@ impl Command for Histogram {
fn signature(&self) -> Signature { fn signature(&self) -> Signature {
Signature::build("histogram") Signature::build("histogram")
.input_output_types(vec![(Type::List(Box::new(Type::Any)), Type::Table(vec![])),]) .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("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") .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')) .named("percentage-type", SyntaxShape::String, "percentage calculate method, can be 'normalize' or 'relative', in 'normalize', defaults to be 'normalize'", Some('t'))
.category(Category::Chart) .category(Category::Chart)
} }

View file

@ -44,7 +44,7 @@ impl Command for SubCommand {
.rest( .rest(
"rest", "rest",
SyntaxShape::CellPath, 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) .category(Category::Conversions)
} }

View file

@ -29,7 +29,7 @@ impl Command for SubCommand {
.rest( .rest(
"rest", "rest",
SyntaxShape::CellPath, 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) .category(Category::Conversions)
} }

View file

@ -104,7 +104,7 @@ impl Command for SubCommand {
.rest( .rest(
"rest", "rest",
SyntaxShape::CellPath, 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) .category(Category::Conversions)
} }

View file

@ -36,7 +36,7 @@ impl Command for SubCommand {
.rest( .rest(
"rest", "rest",
SyntaxShape::CellPath, 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) .category(Category::Conversions)
} }

View file

@ -49,7 +49,7 @@ impl Command for SubCommand {
.rest( .rest(
"rest", "rest",
SyntaxShape::CellPath, 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) .category(Category::Conversions)
} }

View file

@ -31,7 +31,7 @@ impl Command for SubCommand {
.rest( .rest(
"rest", "rest",
SyntaxShape::CellPath, 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) .allow_variants_without_examples(true)
.category(Category::Conversions) .category(Category::Conversions)

View file

@ -81,7 +81,7 @@ impl Command for SubCommand {
.rest( .rest(
"rest", "rest",
SyntaxShape::CellPath, 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) .category(Category::Conversions)
} }

View file

@ -52,7 +52,7 @@ impl Command for SubCommand {
.rest( .rest(
"rest", "rest",
SyntaxShape::CellPath, 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( .named(
"decimals", "decimals",

View file

@ -25,7 +25,7 @@ impl Command for IntoSqliteDb {
.required( .required(
"file_name", "file_name",
SyntaxShape::String, SyntaxShape::String,
"Specify the filename to save the database to", "Specify the filename to save the database to.",
) )
.named( .named(
"table_name", "table_name",

View file

@ -22,7 +22,7 @@ impl Command for QueryDb {
.required( .required(
"SQL", "SQL",
SyntaxShape::String, SyntaxShape::String,
"SQL to execute against the database", "SQL to execute against the database.",
) )
.category(Category::Database) .category(Category::Database)
} }

View file

@ -22,7 +22,7 @@ impl Command for SubCommand {
Signature::build("date to-timezone") Signature::build("date to-timezone")
.input_output_types(vec![(Type::Date, Type::Date), (Type::String, Type::Date)]) .input_output_types(vec![(Type::Date, Type::Date), (Type::String, Type::Date)])
.allow_variants_without_examples(true) // https://github.com/nushell/nushell/issues/7032 .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) .category(Category::Date)
} }

View file

@ -25,7 +25,7 @@ impl Command for Ast {
.required( .required(
"pipeline", "pipeline",
SyntaxShape::String, SyntaxShape::String,
"the pipeline to print the ast for", "The pipeline to print the ast for.",
) )
.switch("json", "serialize to json", Some('j')) .switch("json", "serialize to json", Some('j'))
.switch("minify", "minify the nuon or json output", Some('m')) .switch("minify", "minify the nuon or json output", Some('m'))

View file

@ -23,7 +23,7 @@ impl Command for Explain {
.required( .required(
"closure", "closure",
SyntaxShape::Closure(Some(vec![SyntaxShape::Any])), 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)]) .input_output_types(vec![(Type::Any, Type::Any), (Type::Nothing, Type::Any)])
.allow_variants_without_examples(true) .allow_variants_without_examples(true)

View file

@ -25,7 +25,7 @@ impl Command for Metadata {
.optional( .optional(
"expression", "expression",
SyntaxShape::Any, SyntaxShape::Any,
"the expression you want metadata for", "The expression you want metadata for.",
) )
.category(Category::Debug) .category(Category::Debug)
} }

View file

@ -24,7 +24,7 @@ impl Command for TimeIt {
.required( .required(
"command", "command",
SyntaxShape::OneOf(vec![SyntaxShape::Block, SyntaxShape::Expression]), SyntaxShape::OneOf(vec![SyntaxShape::Block, SyntaxShape::Expression]),
"the command or block to run", "The command or block to run.",
) )
.input_output_types(vec![ .input_output_types(vec![
(Type::Any, Type::Duration), (Type::Any, Type::Duration),

View file

@ -22,7 +22,7 @@ impl Command for ViewSource {
fn signature(&self) -> nu_protocol::Signature { fn signature(&self) -> nu_protocol::Signature {
Signature::build("view source") Signature::build("view source")
.input_output_types(vec![(Type::Nothing, Type::String)]) .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) .category(Category::Debug)
} }

View file

@ -25,8 +25,8 @@ impl Command for ViewSpan {
fn signature(&self) -> nu_protocol::Signature { fn signature(&self) -> nu_protocol::Signature {
Signature::build("view span") Signature::build("view span")
.input_output_types(vec![(Type::Nothing, Type::String)]) .input_output_types(vec![(Type::Nothing, Type::String)])
.required("start", SyntaxShape::Int, "start of the span") .required("start", SyntaxShape::Int, "Start of the span.")
.required("end", SyntaxShape::Int, "end of the span") .required("end", SyntaxShape::Int, "End of the span.")
.category(Category::Debug) .category(Category::Debug)
} }

View file

@ -19,7 +19,7 @@ impl Command for ExportEnv {
.required( .required(
"block", "block",
SyntaxShape::Block, SyntaxShape::Block,
"the block to run to set the environment", "The block to run to set the environment.",
) )
.category(Category::Env) .category(Category::Env)
} }

View file

@ -27,7 +27,7 @@ impl Command for LoadEnv {
.optional( .optional(
"update", "update",
SyntaxShape::Record(vec![]), SyntaxShape::Record(vec![]),
"the record to use for updates", "The record to use for updates.",
) )
.category(Category::FileSystem) .category(Category::FileSystem)
} }

View file

@ -24,7 +24,7 @@ impl Command for SourceEnv {
.required( .required(
"filename", "filename",
SyntaxShape::String, // type is string to avoid automatically canonicalizing the path 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) .category(Category::Core)
} }

View file

@ -21,12 +21,12 @@ impl Command for WithEnv {
.required( .required(
"variable", "variable",
SyntaxShape::Any, SyntaxShape::Any,
"the environment variable to temporarily set", "The environment variable to temporarily set.",
) )
.required( .required(
"block", "block",
SyntaxShape::Closure(None), SyntaxShape::Closure(None),
"the block to run once the variable is set", "The block to run once the variable is set.",
) )
.category(Category::Env) .category(Category::Env)
} }

View file

@ -43,7 +43,7 @@ impl Command for Cd {
fn signature(&self) -> nu_protocol::Signature { fn signature(&self) -> nu_protocol::Signature {
Signature::build("cd") Signature::build("cd")
.input_output_types(vec![(Type::Nothing, Type::Nothing)]) .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![ .input_output_types(vec![
(Type::Nothing, Type::Nothing), (Type::Nothing, Type::Nothing),
(Type::String, Type::Nothing), (Type::String, Type::Nothing),

View file

@ -39,8 +39,8 @@ impl Command for Cp {
fn signature(&self) -> Signature { fn signature(&self) -> Signature {
Signature::build("cp-old") Signature::build("cp-old")
.input_output_types(vec![(Type::Nothing, Type::Nothing)]) .input_output_types(vec![(Type::Nothing, Type::Nothing)])
.required("source", SyntaxShape::GlobPattern, "the place to copy from") .required("source", SyntaxShape::GlobPattern, "The place to copy from.")
.required("destination", SyntaxShape::Filepath, "the place to copy to") .required("destination", SyntaxShape::Filepath, "The place to copy to.")
.switch( .switch(
"recursive", "recursive",
"copy recursively through subdirectories", "copy recursively through subdirectories",

View file

@ -21,7 +21,7 @@ impl Command for Glob {
fn signature(&self) -> Signature { fn signature(&self) -> Signature {
Signature::build("glob") Signature::build("glob")
.input_output_types(vec![(Type::Nothing, Type::List(Box::new(Type::String)))]) .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( .named(
"depth", "depth",
SyntaxShape::Int, SyntaxShape::Int,

View file

@ -39,7 +39,7 @@ impl Command for Ls {
Signature::build("ls") Signature::build("ls")
.input_output_types(vec![(Type::Nothing, Type::Table(vec![]))]) .input_output_types(vec![(Type::Nothing, Type::Table(vec![]))])
// Using a string instead of a glob pattern shape so it won't auto-expand // 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("all", "Show hidden files", Some('a'))
.switch( .switch(
"long", "long",

View file

@ -23,7 +23,7 @@ impl Command for Mkdir {
.rest( .rest(
"rest", "rest",
SyntaxShape::Directory, 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')) .switch("verbose", "print created path(s).", Some('v'))
.category(Category::FileSystem) .category(Category::FileSystem)

View file

@ -33,12 +33,12 @@ impl Command for Mv {
.required( .required(
"source", "source",
SyntaxShape::GlobPattern, SyntaxShape::GlobPattern,
"the location to move files/directories from", "The location to move files/directories from.",
) )
.required( .required(
"destination", "destination",
SyntaxShape::Filepath, SyntaxShape::Filepath,
"the location to move files/directories to", "The location to move files/directories to.",
) )
.switch( .switch(
"verbose", "verbose",

View file

@ -41,11 +41,11 @@ impl Command for Open {
fn signature(&self) -> nu_protocol::Signature { fn signature(&self) -> nu_protocol::Signature {
Signature::build("open") Signature::build("open")
.input_output_types(vec![(Type::Nothing, Type::Any), (Type::String, Type::Any)]) .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( .rest(
"filenames", "filenames",
SyntaxShape::Filepath, SyntaxShape::Filepath,
"optional additional files to open", "Optional additional files to open.",
) )
.switch("raw", "open file as raw binary", Some('r')) .switch("raw", "open file as raw binary", Some('r'))
.category(Category::FileSystem) .category(Category::FileSystem)

View file

@ -44,7 +44,7 @@ impl Command for Rm {
.required( .required(
"filename", "filename",
SyntaxShape::GlobPattern, SyntaxShape::GlobPattern,
"the file or files you want to remove", "The file or files you want to remove.",
) )
.switch( .switch(
"trash", "trash",
@ -68,7 +68,7 @@ impl Command for Rm {
.rest( .rest(
"rest", "rest",
SyntaxShape::GlobPattern, SyntaxShape::GlobPattern,
"additional file path(s) to remove", "Additional file path(s) to remove.",
) )
.category(Category::FileSystem) .category(Category::FileSystem)
} }

View file

@ -42,7 +42,7 @@ impl Command for Save {
fn signature(&self) -> nu_protocol::Signature { fn signature(&self) -> nu_protocol::Signature {
Signature::build("save") Signature::build("save")
.input_output_types(vec![(Type::Any, Type::Nothing)]) .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( .named(
"stderr", "stderr",
SyntaxShape::Filepath, SyntaxShape::Filepath,

View file

@ -30,7 +30,7 @@ impl Command for Start {
fn signature(&self) -> nu_protocol::Signature { fn signature(&self) -> nu_protocol::Signature {
Signature::build("start") Signature::build("start")
.input_output_types(vec![(Type::Nothing, Type::Any), (Type::String, Type::Any)]) .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) .category(Category::FileSystem)
} }

View file

@ -29,7 +29,7 @@ impl Command for Touch {
.required( .required(
"filename", "filename",
SyntaxShape::Filepath, SyntaxShape::Filepath,
"the path of the file you want to create", "The path of the file you want to create.",
) )
.named( .named(
"reference", "reference",
@ -52,7 +52,7 @@ impl Command for Touch {
"do not create the file if it does not exist", "do not create the file if it does not exist",
Some('c'), Some('c'),
) )
.rest("rest", SyntaxShape::Filepath, "additional files to create") .rest("rest", SyntaxShape::Filepath, "Additional files to create.")
.category(Category::FileSystem) .category(Category::FileSystem)
} }

View file

@ -54,7 +54,7 @@ impl Command for UCp {
.switch("progress", "display a progress bar", Some('p')) .switch("progress", "display a progress bar", Some('p'))
.switch("no-clobber", "do not overwrite an existing file", Some('n')) .switch("no-clobber", "do not overwrite an existing file", Some('n'))
.switch("debug", "explain how a file is copied. Implies -v", None) .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) .allow_variants_without_examples(true)
.category(Category::FileSystem) .category(Category::FileSystem)
} }

View file

@ -33,7 +33,7 @@ impl Command for UMkdir {
.rest( .rest(
"rest", "rest",
SyntaxShape::Directory, SyntaxShape::Directory,
"the name(s) of the path(s) to create", "The name(s) of the path(s) to create.",
) )
.switch( .switch(
"verbose", "verbose",

View file

@ -40,10 +40,10 @@ impl Command for Watch {
fn signature(&self) -> nu_protocol::Signature { fn signature(&self) -> nu_protocol::Signature {
Signature::build("watch") Signature::build("watch")
.input_output_types(vec![(Type::Nothing, Type::Table(vec![]))]) .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", .required("closure",
SyntaxShape::Closure(Some(vec![SyntaxShape::String, SyntaxShape::String, SyntaxShape::String])), 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( .named(
"debounce-ms", "debounce-ms",
SyntaxShape::Int, SyntaxShape::Int,

View file

@ -23,7 +23,7 @@ impl Command for All {
.required( .required(
"predicate", "predicate",
SyntaxShape::Closure(Some(vec![SyntaxShape::Any, SyntaxShape::Int])), 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) .category(Category::Filters)
} }

View file

@ -23,7 +23,7 @@ impl Command for Any {
.required( .required(
"predicate", "predicate",
SyntaxShape::Closure(Some(vec![SyntaxShape::Any, SyntaxShape::Int])), 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) .category(Category::Filters)
} }

View file

@ -17,7 +17,11 @@ impl Command for Append {
fn signature(&self) -> nu_protocol::Signature { fn signature(&self) -> nu_protocol::Signature {
Signature::build("append") Signature::build("append")
.input_output_types(vec![(Type::Any, Type::List(Box::new(Type::Any)))]) .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) .allow_variants_without_examples(true)
.category(Category::Filters) .category(Category::Filters)
} }

View file

@ -35,7 +35,7 @@ impl Command for Compact {
.rest( .rest(
"columns", "columns",
SyntaxShape::Any, SyntaxShape::Any,
"the columns to compact from the table", "The columns to compact from the table.",
) )
.category(Category::Filters) .category(Category::Filters)
} }

View file

@ -22,9 +22,13 @@ impl Command for Default {
.required( .required(
"default value", "default value",
SyntaxShape::Any, 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) .category(Category::Filters)
} }

View file

@ -25,7 +25,7 @@ impl Command for DropColumn {
.optional( .optional(
"columns", "columns",
SyntaxShape::Int, 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) .category(Category::Filters)
} }

View file

@ -24,7 +24,7 @@ impl Command for Drop {
Type::List(Box::new(Type::Any)), 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) .category(Category::Filters)
} }

View file

@ -25,9 +25,9 @@ impl Command for DropNth {
"row number or row range", "row number or row range",
// FIXME: we can make this accept either Int or Range when we can compose SyntaxShapes // FIXME: we can make this accept either Int or Range when we can compose SyntaxShapes
SyntaxShape::Any, 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) .category(Category::Filters)
} }

View file

@ -46,7 +46,7 @@ with 'transpose' first."#
.required( .required(
"closure", "closure",
SyntaxShape::Closure(Some(vec![SyntaxShape::Any, SyntaxShape::Int])), 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')) .switch("keep-empty", "keep empty result cells", Some('k'))
.allow_variants_without_examples(true) .allow_variants_without_examples(true)

View file

@ -20,7 +20,7 @@ impl Command for Empty {
.rest( .rest(
"rest", "rest",
SyntaxShape::CellPath, SyntaxShape::CellPath,
"the names of the columns to check emptiness", "The names of the columns to check emptiness.",
) )
.category(Category::Filters) .category(Category::Filters)
} }

View file

@ -24,7 +24,7 @@ impl Command for Every {
.required( .required(
"stride", "stride",
SyntaxShape::Int, 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( .switch(
"skip", "skip",

View file

@ -37,7 +37,7 @@ a variable. On the other hand, the "row condition" syntax is not supported."#
.required( .required(
"closure", "closure",
SyntaxShape::Closure(Some(vec![SyntaxShape::Any, SyntaxShape::Int])), SyntaxShape::Closure(Some(vec![SyntaxShape::Any, SyntaxShape::Int])),
"Predicate closure", "Predicate closure.",
) )
.category(Category::Filters) .category(Category::Filters)
} }

View file

@ -64,7 +64,7 @@ impl Command for Find {
Some('c'), Some('c'),
) )
.switch("invert", "invert the match", Some('v')) .switch("invert", "invert the match", Some('v'))
.rest("rest", SyntaxShape::Any, "terms to search") .rest("rest", SyntaxShape::Any, "Terms to search.")
.category(Category::Filters) .category(Category::Filters)
} }

View file

@ -38,7 +38,7 @@ impl Command for First {
.optional( .optional(
"rows", "rows",
SyntaxShape::Int, 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) .allow_variants_without_examples(true)
.category(Category::Filters) .category(Category::Filters)

View file

@ -28,7 +28,7 @@ impl Command for Flatten {
.rest( .rest(
"rest", "rest",
SyntaxShape::String, SyntaxShape::String,
"optionally flatten data by column", "Optionally flatten data by column.",
) )
.switch("all", "flatten inner table one level out", Some('a')) .switch("all", "flatten inner table one level out", Some('a'))
.category(Category::Filters) .category(Category::Filters)

View file

@ -39,9 +39,9 @@ If multiple cell paths are given, this will produce a list of values."#
.required( .required(
"cell_path", "cell_path",
SyntaxShape::CellPath, 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( .switch(
"ignore-errors", "ignore-errors",
"ignore missing data (make all cell path members optional)", "ignore missing data (make all cell path members optional)",

View file

@ -24,7 +24,7 @@ impl Command for Group {
Type::List(Box::new(Type::Any)), Type::List(Box::new(Type::Any)),
Type::List(Box::new(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) .category(Category::Filters)
} }

View file

@ -39,7 +39,7 @@ impl Command for GroupBy {
SyntaxShape::Closure(None), SyntaxShape::Closure(None),
SyntaxShape::Closure(Some(vec![SyntaxShape::Any])), 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) .category(Category::Filters)
} }

View file

@ -27,12 +27,12 @@ impl Command for Insert {
.required( .required(
"field", "field",
SyntaxShape::CellPath, SyntaxShape::CellPath,
"the name of the column to insert", "The name of the column to insert.",
) )
.required( .required(
"new value", "new value",
SyntaxShape::Any, SyntaxShape::Any,
"the new value to give the cell(s)", "The new value to give the cell(s).",
) )
.allow_variants_without_examples(true) .allow_variants_without_examples(true)
.category(Category::Filters) .category(Category::Filters)

View file

@ -22,7 +22,7 @@ impl Command for Items {
.required( .required(
"closure", "closure",
SyntaxShape::Closure(Some(vec![SyntaxShape::Any, SyntaxShape::Any])), SyntaxShape::Closure(Some(vec![SyntaxShape::Any, SyntaxShape::Any])),
"the closure to run", "The closure to run.",
) )
.allow_variants_without_examples(true) .allow_variants_without_examples(true)
.category(Category::Filters) .category(Category::Filters)

View file

@ -33,12 +33,12 @@ impl Command for Join {
.required( .required(
"right-table", "right-table",
SyntaxShape::List(Box::new(SyntaxShape::Any)), SyntaxShape::List(Box::new(SyntaxShape::Any)),
"The right table in the join", "The right table in the join.",
) )
.required( .required(
"left-on", "left-on",
SyntaxShape::String, SyntaxShape::String,
"Name of column in input (left) table to join on", "Name of column in input (left) table to join on.",
) )
.optional( .optional(
"right-on", "right-on",

View file

@ -31,7 +31,7 @@ impl Command for Last {
.optional( .optional(
"rows", "rows",
SyntaxShape::Int, 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) .category(Category::Filters)
} }

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