mirror of
https://github.com/nushell/nushell
synced 2024-11-10 15:14:14 +00:00
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:
parent
c2b684464f
commit
5b01685fc3
196 changed files with 383 additions and 281 deletions
|
@ -19,11 +19,11 @@ impl Command for Alias {
|
|||
fn signature(&self) -> nu_protocol::Signature {
|
||||
Signature::build("alias")
|
||||
.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(
|
||||
"initial_value",
|
||||
SyntaxShape::Keyword(b"=".to_vec(), Box::new(SyntaxShape::Expression)),
|
||||
"equals sign followed by value",
|
||||
"Equals sign followed by value.",
|
||||
)
|
||||
.category(Category::Core)
|
||||
}
|
||||
|
|
|
@ -20,7 +20,7 @@ impl Command for Collect {
|
|||
.required(
|
||||
"closure",
|
||||
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(
|
||||
"keep-env",
|
||||
|
|
|
@ -18,11 +18,11 @@ impl Command for Const {
|
|||
Signature::build("const")
|
||||
.input_output_types(vec![(Type::Nothing, Type::Nothing)])
|
||||
.allow_variants_without_examples(true)
|
||||
.required("const_name", SyntaxShape::VarWithOptType, "constant name")
|
||||
.required("const_name", SyntaxShape::VarWithOptType, "Constant name.")
|
||||
.required(
|
||||
"initial_value",
|
||||
SyntaxShape::Keyword(b"=".to_vec(), Box::new(SyntaxShape::MathExpression)),
|
||||
"equals sign followed by constant value",
|
||||
"Equals sign followed by constant value.",
|
||||
)
|
||||
.category(Category::Core)
|
||||
}
|
||||
|
|
|
@ -19,9 +19,9 @@ impl Command for Def {
|
|||
fn signature(&self) -> nu_protocol::Signature {
|
||||
Signature::build("def")
|
||||
.input_output_types(vec![(Type::Nothing, Type::Nothing)])
|
||||
.required("def_name", SyntaxShape::String, "command name")
|
||||
.required("params", SyntaxShape::Signature, "parameters")
|
||||
.required("block", SyntaxShape::Closure(None), "body of the definition")
|
||||
.required("def_name", SyntaxShape::String, "Command name.")
|
||||
.required("params", SyntaxShape::Signature, "Parameters.")
|
||||
.required("block", SyntaxShape::Closure(None), "Body of the definition.")
|
||||
.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)
|
||||
.category(Category::Core)
|
||||
|
|
|
@ -25,7 +25,7 @@ impl Command for Do {
|
|||
.required(
|
||||
"closure",
|
||||
SyntaxShape::OneOf(vec![SyntaxShape::Closure(None), SyntaxShape::Any]),
|
||||
"the closure to run",
|
||||
"The closure to run.",
|
||||
)
|
||||
.input_output_types(vec![(Type::Any, Type::Any)])
|
||||
.switch(
|
||||
|
@ -53,7 +53,11 @@ impl Command for Do {
|
|||
"keep the environment defined inside the command",
|
||||
None,
|
||||
)
|
||||
.rest("rest", SyntaxShape::Any, "the parameter(s) for the closure")
|
||||
.rest(
|
||||
"rest",
|
||||
SyntaxShape::Any,
|
||||
"The parameter(s) for the closure.",
|
||||
)
|
||||
.category(Category::Core)
|
||||
}
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@ impl Command for Echo {
|
|||
fn signature(&self) -> Signature {
|
||||
Signature::build("echo")
|
||||
.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)
|
||||
}
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@ impl Command for ErrorMake {
|
|||
.required(
|
||||
"error_struct",
|
||||
SyntaxShape::Record(vec![]),
|
||||
"the error to create",
|
||||
"The error to create.",
|
||||
)
|
||||
.switch(
|
||||
"unspanned",
|
||||
|
|
|
@ -19,11 +19,11 @@ impl Command for ExportAlias {
|
|||
fn signature(&self) -> nu_protocol::Signature {
|
||||
Signature::build("export alias")
|
||||
.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(
|
||||
"initial_value",
|
||||
SyntaxShape::Keyword(b"=".to_vec(), Box::new(SyntaxShape::Expression)),
|
||||
"equals sign followed by value",
|
||||
"Equals sign followed by value.",
|
||||
)
|
||||
.category(Category::Core)
|
||||
}
|
||||
|
|
|
@ -20,11 +20,11 @@ impl Command for ExportConst {
|
|||
Signature::build("export const")
|
||||
.input_output_types(vec![(Type::Nothing, Type::Nothing)])
|
||||
.allow_variants_without_examples(true)
|
||||
.required("const_name", SyntaxShape::VarWithOptType, "constant name")
|
||||
.required("const_name", SyntaxShape::VarWithOptType, "Constant name.")
|
||||
.required(
|
||||
"initial_value",
|
||||
SyntaxShape::Keyword(b"=".to_vec(), Box::new(SyntaxShape::MathExpression)),
|
||||
"equals sign followed by constant value",
|
||||
"Equals sign followed by constant value.",
|
||||
)
|
||||
.category(Category::Core)
|
||||
}
|
||||
|
|
|
@ -19,9 +19,9 @@ impl Command for ExportDef {
|
|||
fn signature(&self) -> nu_protocol::Signature {
|
||||
Signature::build("export def")
|
||||
.input_output_types(vec![(Type::Nothing, Type::Nothing)])
|
||||
.required("def_name", SyntaxShape::String, "command name")
|
||||
.required("params", SyntaxShape::Signature, "parameters")
|
||||
.required("block", SyntaxShape::Block, "body of the definition")
|
||||
.required("def_name", SyntaxShape::String, "Command name.")
|
||||
.required("params", SyntaxShape::Signature, "Parameters.")
|
||||
.required("block", SyntaxShape::Block, "Body of the definition.")
|
||||
.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)
|
||||
.category(Category::Core)
|
||||
|
|
|
@ -17,8 +17,8 @@ impl Command for ExportExtern {
|
|||
fn signature(&self) -> nu_protocol::Signature {
|
||||
Signature::build("export extern")
|
||||
.input_output_types(vec![(Type::Nothing, Type::Nothing)])
|
||||
.required("def_name", SyntaxShape::String, "definition name")
|
||||
.required("params", SyntaxShape::Signature, "parameters")
|
||||
.required("def_name", SyntaxShape::String, "Definition name.")
|
||||
.required("params", SyntaxShape::Signature, "Parameters.")
|
||||
.category(Category::Core)
|
||||
}
|
||||
|
||||
|
|
|
@ -20,11 +20,11 @@ impl Command for ExportModule {
|
|||
Signature::build("export module")
|
||||
.input_output_types(vec![(Type::Nothing, Type::Nothing)])
|
||||
.allow_variants_without_examples(true)
|
||||
.required("module", SyntaxShape::String, "module name or module path")
|
||||
.required("module", SyntaxShape::String, "Module name or module path.")
|
||||
.optional(
|
||||
"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)
|
||||
}
|
||||
|
|
|
@ -19,11 +19,11 @@ impl Command for ExportUse {
|
|||
fn signature(&self) -> nu_protocol::Signature {
|
||||
Signature::build("export use")
|
||||
.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(
|
||||
"members",
|
||||
SyntaxShape::Any,
|
||||
"Which members of the module to import",
|
||||
"Which members of the module to import.",
|
||||
)
|
||||
.category(Category::Core)
|
||||
}
|
||||
|
|
|
@ -17,8 +17,8 @@ impl Command for Extern {
|
|||
fn signature(&self) -> nu_protocol::Signature {
|
||||
Signature::build("extern")
|
||||
.input_output_types(vec![(Type::Nothing, Type::Nothing)])
|
||||
.required("def_name", SyntaxShape::String, "definition name")
|
||||
.required("params", SyntaxShape::Signature, "parameters")
|
||||
.required("def_name", SyntaxShape::String, "Definition name.")
|
||||
.required("params", SyntaxShape::Signature, "Parameters.")
|
||||
.category(Category::Core)
|
||||
}
|
||||
|
||||
|
|
|
@ -25,14 +25,14 @@ impl Command for For {
|
|||
.required(
|
||||
"var_name",
|
||||
SyntaxShape::VarWithOptType,
|
||||
"name of the looping variable",
|
||||
"Name of the looping variable.",
|
||||
)
|
||||
.required(
|
||||
"range",
|
||||
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(
|
||||
"numbered",
|
||||
"return a numbered item ($it.index and $it.item)",
|
||||
|
|
|
@ -13,11 +13,11 @@ impl Command for Hide {
|
|||
fn signature(&self) -> nu_protocol::Signature {
|
||||
Signature::build("hide")
|
||||
.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(
|
||||
"members",
|
||||
SyntaxShape::Any,
|
||||
"Which members of the module to import",
|
||||
"Which members of the module to import.",
|
||||
)
|
||||
.category(Category::Core)
|
||||
}
|
||||
|
|
|
@ -20,7 +20,7 @@ impl Command for HideEnv {
|
|||
.rest(
|
||||
"name",
|
||||
SyntaxShape::String,
|
||||
"environment variable names to hide",
|
||||
"Environment variable names to hide.",
|
||||
)
|
||||
.switch(
|
||||
"ignore-errors",
|
||||
|
|
|
@ -21,11 +21,11 @@ impl Command for If {
|
|||
fn signature(&self) -> nu_protocol::Signature {
|
||||
Signature::build("if")
|
||||
.input_output_types(vec![(Type::Any, Type::Any)])
|
||||
.required("cond", SyntaxShape::MathExpression, "condition to check")
|
||||
.required("cond", SyntaxShape::MathExpression, "Condition to check.")
|
||||
.required(
|
||||
"then_block",
|
||||
SyntaxShape::Block,
|
||||
"block to run if check succeeds",
|
||||
"Block to run if check succeeds.",
|
||||
)
|
||||
.optional(
|
||||
"else_expression",
|
||||
|
@ -36,7 +36,7 @@ impl Command for If {
|
|||
SyntaxShape::Expression,
|
||||
])),
|
||||
),
|
||||
"expression or block to run if check fails",
|
||||
"Expression or block to run when the condition is false.",
|
||||
)
|
||||
.category(Category::Core)
|
||||
}
|
||||
|
|
|
@ -19,11 +19,11 @@ impl Command for Let {
|
|||
Signature::build("let")
|
||||
.input_output_types(vec![(Type::Any, Type::Nothing)])
|
||||
.allow_variants_without_examples(true)
|
||||
.required("var_name", SyntaxShape::VarWithOptType, "variable name")
|
||||
.required("var_name", SyntaxShape::VarWithOptType, "Variable name.")
|
||||
.required(
|
||||
"initial_value",
|
||||
SyntaxShape::Keyword(b"=".to_vec(), Box::new(SyntaxShape::MathExpression)),
|
||||
"equals sign followed by value",
|
||||
"Equals sign followed by value.",
|
||||
)
|
||||
.category(Category::Core)
|
||||
}
|
||||
|
|
|
@ -21,7 +21,7 @@ impl Command for Loop {
|
|||
Signature::build("loop")
|
||||
.input_output_types(vec![(Type::Nothing, Type::Nothing)])
|
||||
.allow_variants_without_examples(true)
|
||||
.required("block", SyntaxShape::Block, "block to loop")
|
||||
.required("block", SyntaxShape::Block, "Block to loop.")
|
||||
.category(Category::Core)
|
||||
}
|
||||
|
||||
|
|
|
@ -20,11 +20,11 @@ impl Command for Match {
|
|||
fn signature(&self) -> nu_protocol::Signature {
|
||||
Signature::build("match")
|
||||
.input_output_types(vec![(Type::Any, Type::Any)])
|
||||
.required("value", SyntaxShape::Any, "value to check")
|
||||
.required("value", SyntaxShape::Any, "Value to check.")
|
||||
.required(
|
||||
"match_block",
|
||||
SyntaxShape::MatchBlock,
|
||||
"block to run if check succeeds",
|
||||
"Block to run if check succeeds.",
|
||||
)
|
||||
.category(Category::Core)
|
||||
}
|
||||
|
|
|
@ -20,11 +20,11 @@ impl Command for Module {
|
|||
Signature::build("module")
|
||||
.input_output_types(vec![(Type::Nothing, Type::Nothing)])
|
||||
.allow_variants_without_examples(true)
|
||||
.required("module", SyntaxShape::String, "module name or module path")
|
||||
.required("module", SyntaxShape::String, "Module name or module path.")
|
||||
.optional(
|
||||
"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)
|
||||
}
|
||||
|
|
|
@ -19,11 +19,11 @@ impl Command for Mut {
|
|||
Signature::build("mut")
|
||||
.input_output_types(vec![(Type::Any, Type::Nothing)])
|
||||
.allow_variants_without_examples(true)
|
||||
.required("var_name", SyntaxShape::VarWithOptType, "variable name")
|
||||
.required("var_name", SyntaxShape::VarWithOptType, "Variable name.")
|
||||
.required(
|
||||
"initial_value",
|
||||
SyntaxShape::Keyword(b"=".to_vec(), Box::new(SyntaxShape::MathExpression)),
|
||||
"equals sign followed by value",
|
||||
"Equals sign followed by value.",
|
||||
)
|
||||
.category(Category::Core)
|
||||
}
|
||||
|
|
|
@ -20,10 +20,10 @@ impl Command for OverlayHide {
|
|||
fn signature(&self) -> nu_protocol::Signature {
|
||||
Signature::build("overlay hide")
|
||||
.input_output_types(vec![(Type::Nothing, Type::Nothing)])
|
||||
.optional("name", SyntaxShape::String, "Overlay to hide")
|
||||
.optional("name", SyntaxShape::String, "Overlay to hide.")
|
||||
.switch(
|
||||
"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'),
|
||||
)
|
||||
.named(
|
||||
|
|
|
@ -21,7 +21,7 @@ impl Command for OverlayNew {
|
|||
Signature::build("overlay new")
|
||||
.input_output_types(vec![(Type::Nothing, Type::Nothing)])
|
||||
.allow_variants_without_examples(true)
|
||||
.required("name", SyntaxShape::String, "Name of the overlay")
|
||||
.required("name", SyntaxShape::String, "Name of the overlay.")
|
||||
// TODO:
|
||||
// .switch(
|
||||
// "prefix",
|
||||
|
|
|
@ -27,12 +27,12 @@ impl Command for OverlayUse {
|
|||
.required(
|
||||
"name",
|
||||
SyntaxShape::String,
|
||||
"Module name to use overlay for",
|
||||
"Module name to use overlay for.",
|
||||
)
|
||||
.optional(
|
||||
"as",
|
||||
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(
|
||||
"prefix",
|
||||
|
|
|
@ -20,12 +20,12 @@ impl Command for Register {
|
|||
.required(
|
||||
"plugin",
|
||||
SyntaxShape::Filepath,
|
||||
"path of executable for plugin",
|
||||
"Path of executable for plugin.",
|
||||
)
|
||||
.optional(
|
||||
"signature",
|
||||
SyntaxShape::Any,
|
||||
"Block with signature description as json object",
|
||||
"Block with signature description as json object.",
|
||||
)
|
||||
.named(
|
||||
"shell",
|
||||
|
|
|
@ -20,7 +20,11 @@ impl Command for Return {
|
|||
fn signature(&self) -> nu_protocol::Signature {
|
||||
Signature::build("return")
|
||||
.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)
|
||||
}
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@ impl Command for Try {
|
|||
fn signature(&self) -> nu_protocol::Signature {
|
||||
Signature::build("try")
|
||||
.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(
|
||||
"catch_block",
|
||||
SyntaxShape::Keyword(
|
||||
|
@ -31,7 +31,7 @@ impl Command for Try {
|
|||
SyntaxShape::Closure(Some(vec![SyntaxShape::Any])),
|
||||
])),
|
||||
),
|
||||
"block to run if try block fails",
|
||||
"Block to run if try block fails.",
|
||||
)
|
||||
.category(Category::Core)
|
||||
}
|
||||
|
|
|
@ -21,11 +21,11 @@ impl Command for Use {
|
|||
Signature::build("use")
|
||||
.input_output_types(vec![(Type::Nothing, Type::Nothing)])
|
||||
.allow_variants_without_examples(true)
|
||||
.required("module", SyntaxShape::String, "Module or module file")
|
||||
.required("module", SyntaxShape::String, "Module or module file.")
|
||||
.rest(
|
||||
"members",
|
||||
SyntaxShape::Any,
|
||||
"Which members of the module to import",
|
||||
"Which members of the module to import.",
|
||||
)
|
||||
.category(Category::Core)
|
||||
}
|
||||
|
|
|
@ -21,11 +21,11 @@ impl Command for While {
|
|||
Signature::build("while")
|
||||
.input_output_types(vec![(Type::Nothing, Type::Nothing)])
|
||||
.allow_variants_without_examples(true)
|
||||
.required("cond", SyntaxShape::MathExpression, "condition to check")
|
||||
.required("cond", SyntaxShape::MathExpression, "Condition to check.")
|
||||
.required(
|
||||
"block",
|
||||
SyntaxShape::Block,
|
||||
"block to loop if check succeeds",
|
||||
"Block to loop if check succeeds.",
|
||||
)
|
||||
.category(Category::Core)
|
||||
}
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue