mirror of
https://github.com/nushell/nushell.git
synced 2025-08-09 20:17:44 +02:00
Allow different names for ...rest (#3954)
* Allow different names for ...rest * Resolves #3945 * This change requires an explicit name for the rest argument in `WholeStreamCommand`, which is why there are so many changed files. * Remove redundant clone * Add tests
This commit is contained in:
@ -22,6 +22,7 @@ impl WholeStreamCommand for Histogram {
|
||||
None,
|
||||
)
|
||||
.rest(
|
||||
"rest",
|
||||
SyntaxShape::ColumnPath,
|
||||
"column name to give the histogram's frequency column",
|
||||
)
|
||||
|
@ -13,6 +13,7 @@ impl WholeStreamCommand for SubCommand {
|
||||
|
||||
fn signature(&self) -> Signature {
|
||||
Signature::build("into binary").rest(
|
||||
"rest",
|
||||
SyntaxShape::ColumnPath,
|
||||
"column paths to convert to binary (for table input)",
|
||||
)
|
||||
|
@ -14,6 +14,7 @@ impl WholeStreamCommand for SubCommand {
|
||||
|
||||
fn signature(&self) -> Signature {
|
||||
Signature::build("into path").rest(
|
||||
"rest",
|
||||
SyntaxShape::ColumnPath,
|
||||
"column paths to convert to filepath (for table input)",
|
||||
)
|
||||
|
@ -13,6 +13,7 @@ impl WholeStreamCommand for SubCommand {
|
||||
|
||||
fn signature(&self) -> Signature {
|
||||
Signature::build("into int").rest(
|
||||
"rest",
|
||||
SyntaxShape::ColumnPath,
|
||||
"column paths to convert to int (for table input)",
|
||||
)
|
||||
|
@ -20,6 +20,7 @@ impl WholeStreamCommand for SubCommand {
|
||||
fn signature(&self) -> Signature {
|
||||
Signature::build("into string")
|
||||
.rest(
|
||||
"rest",
|
||||
SyntaxShape::ColumnPath,
|
||||
"column paths to convert to string (for table input)",
|
||||
)
|
||||
|
@ -15,7 +15,7 @@ impl WholeStreamCommand for Alias {
|
||||
Signature::build("alias")
|
||||
.required("name", SyntaxShape::String, "the name of the alias")
|
||||
.required("equals", SyntaxShape::String, "the equals sign")
|
||||
.rest(SyntaxShape::Any, "the expansion for the alias")
|
||||
.rest("rest", SyntaxShape::Any, "the expansion for the alias")
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
|
@ -27,7 +27,7 @@ impl WholeStreamCommand for Do {
|
||||
"ignore errors as the block runs",
|
||||
Some('i'),
|
||||
)
|
||||
.rest(SyntaxShape::Any, "the parameter(s) for the block")
|
||||
.rest("rest", SyntaxShape::Any, "the parameter(s) for the block")
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
|
@ -12,7 +12,7 @@ impl WholeStreamCommand for Echo {
|
||||
}
|
||||
|
||||
fn signature(&self) -> Signature {
|
||||
Signature::build("echo").rest(SyntaxShape::Any, "the values to echo")
|
||||
Signature::build("echo").rest("rest", SyntaxShape::Any, "the values to echo")
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
|
@ -18,7 +18,11 @@ impl WholeStreamCommand for Help {
|
||||
|
||||
fn signature(&self) -> Signature {
|
||||
Signature::build("help")
|
||||
.rest(SyntaxShape::String, "the name of command to get help on")
|
||||
.rest(
|
||||
"rest",
|
||||
SyntaxShape::String,
|
||||
"the name of command to get help on",
|
||||
)
|
||||
.named(
|
||||
"find",
|
||||
SyntaxShape::String,
|
||||
|
@ -41,7 +41,7 @@ impl WholeStreamCommand for Command {
|
||||
"custom configuration source file",
|
||||
None,
|
||||
)
|
||||
.rest(SyntaxShape::String, "source file(s) to run")
|
||||
.rest("rest", SyntaxShape::String, "source file(s) to run")
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
|
@ -20,7 +20,11 @@ impl WholeStreamCommand for DataFrame {
|
||||
}
|
||||
|
||||
fn signature(&self) -> Signature {
|
||||
Signature::build("dataframe drop").rest(SyntaxShape::Any, "column names to be dropped")
|
||||
Signature::build("dataframe drop").rest(
|
||||
"rest",
|
||||
SyntaxShape::Any,
|
||||
"column names to be dropped",
|
||||
)
|
||||
}
|
||||
|
||||
fn run(&self, args: CommandArgs) -> Result<OutputStream, ShellError> {
|
||||
|
@ -19,7 +19,11 @@ impl WholeStreamCommand for DataFrame {
|
||||
}
|
||||
|
||||
fn signature(&self) -> Signature {
|
||||
Signature::build("dataframe get").rest(SyntaxShape::Any, "column names to sort dataframe")
|
||||
Signature::build("dataframe get").rest(
|
||||
"rest",
|
||||
SyntaxShape::Any,
|
||||
"column names to sort dataframe",
|
||||
)
|
||||
}
|
||||
|
||||
fn run(&self, args: CommandArgs) -> Result<OutputStream, ShellError> {
|
||||
|
@ -20,7 +20,7 @@ impl WholeStreamCommand for DataFrame {
|
||||
}
|
||||
|
||||
fn signature(&self) -> Signature {
|
||||
Signature::build("dataframe group-by").rest(SyntaxShape::Any, "groupby columns")
|
||||
Signature::build("dataframe group-by").rest("rest", SyntaxShape::Any, "groupby columns")
|
||||
}
|
||||
|
||||
fn run(&self, args: CommandArgs) -> Result<OutputStream, ShellError> {
|
||||
|
@ -20,7 +20,7 @@ impl WholeStreamCommand for DataFrame {
|
||||
}
|
||||
|
||||
fn signature(&self) -> Signature {
|
||||
Signature::build("dataframe select").rest(SyntaxShape::Any, "selected column names")
|
||||
Signature::build("dataframe select").rest("rest", SyntaxShape::Any, "selected column names")
|
||||
}
|
||||
|
||||
fn run(&self, args: CommandArgs) -> Result<OutputStream, ShellError> {
|
||||
|
@ -21,7 +21,7 @@ impl WholeStreamCommand for DataFrame {
|
||||
fn signature(&self) -> Signature {
|
||||
Signature::build("dataframe sort")
|
||||
.switch("reverse", "invert sort", Some('r'))
|
||||
.rest(SyntaxShape::Any, "column names to sort dataframe")
|
||||
.rest("rest", SyntaxShape::Any, "column names to sort dataframe")
|
||||
}
|
||||
|
||||
fn run(&self, args: CommandArgs) -> Result<OutputStream, ShellError> {
|
||||
|
@ -12,6 +12,7 @@ impl WholeStreamCommand for Mkdir {
|
||||
fn signature(&self) -> Signature {
|
||||
Signature::build("mkdir")
|
||||
.rest(
|
||||
"rest",
|
||||
SyntaxShape::FilePath,
|
||||
"the name(s) of the path(s) to create",
|
||||
)
|
||||
|
@ -26,7 +26,11 @@ impl WholeStreamCommand for Remove {
|
||||
)
|
||||
.switch("recursive", "delete subdirectories recursively", Some('r'))
|
||||
.switch("force", "suppress error when no file", Some('f'))
|
||||
.rest(SyntaxShape::GlobPattern, "the file path(s) to remove")
|
||||
.rest(
|
||||
"rest",
|
||||
SyntaxShape::GlobPattern,
|
||||
"the file path(s) to remove",
|
||||
)
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
|
@ -19,7 +19,7 @@ impl WholeStreamCommand for Touch {
|
||||
SyntaxShape::FilePath,
|
||||
"the path of the file you want to create",
|
||||
)
|
||||
.rest(SyntaxShape::FilePath, "additional files to create")
|
||||
.rest("rest", SyntaxShape::FilePath, "additional files to create")
|
||||
}
|
||||
fn usage(&self) -> &str {
|
||||
"Creates one or more files."
|
||||
|
@ -17,7 +17,11 @@ impl WholeStreamCommand for Compact {
|
||||
}
|
||||
|
||||
fn signature(&self) -> Signature {
|
||||
Signature::build("compact").rest(SyntaxShape::Any, "the columns to compact from the table")
|
||||
Signature::build("compact").rest(
|
||||
"rest",
|
||||
SyntaxShape::Any,
|
||||
"the columns to compact from the table",
|
||||
)
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
|
@ -18,7 +18,7 @@ impl WholeStreamCommand for SubCommand {
|
||||
SyntaxShape::Int,
|
||||
"the number of the row to drop",
|
||||
)
|
||||
.rest(SyntaxShape::Any, "Optionally drop more rows")
|
||||
.rest("rest", SyntaxShape::Any, "Optionally drop more rows")
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
|
@ -19,6 +19,7 @@ impl WholeStreamCommand for Command {
|
||||
fn signature(&self) -> Signature {
|
||||
Signature::build("empty?")
|
||||
.rest(
|
||||
"rest",
|
||||
SyntaxShape::ColumnPath,
|
||||
"the names of the columns to check emptiness",
|
||||
)
|
||||
|
@ -14,7 +14,11 @@ impl WholeStreamCommand for Command {
|
||||
}
|
||||
|
||||
fn signature(&self) -> Signature {
|
||||
Signature::build("flatten").rest(SyntaxShape::String, "optionally flatten data by column")
|
||||
Signature::build("flatten").rest(
|
||||
"rest",
|
||||
SyntaxShape::String,
|
||||
"optionally flatten data by column",
|
||||
)
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
|
@ -19,6 +19,7 @@ impl WholeStreamCommand for Command {
|
||||
|
||||
fn signature(&self) -> Signature {
|
||||
Signature::build("get").rest(
|
||||
"rest",
|
||||
SyntaxShape::ColumnPath,
|
||||
"optionally return additional data by path",
|
||||
)
|
||||
|
@ -14,7 +14,7 @@ impl WholeStreamCommand for Command {
|
||||
|
||||
fn signature(&self) -> Signature {
|
||||
Signature::build("move")
|
||||
.rest(SyntaxShape::ColumnPath, "the columns to move")
|
||||
.rest("rest", SyntaxShape::ColumnPath, "the columns to move")
|
||||
.named(
|
||||
"after",
|
||||
SyntaxShape::ColumnPath,
|
||||
|
@ -18,7 +18,7 @@ impl WholeStreamCommand for Nth {
|
||||
SyntaxShape::Int,
|
||||
"the number of the row to return",
|
||||
)
|
||||
.rest(SyntaxShape::Any, "Optionally return more rows")
|
||||
.rest("rest", SyntaxShape::Any, "Optionally return more rows")
|
||||
.switch("skip", "Skip the rows instead of selecting them", Some('s'))
|
||||
}
|
||||
|
||||
|
@ -36,6 +36,7 @@ impl WholeStreamCommand for Pivot {
|
||||
Some('i'),
|
||||
)
|
||||
.rest(
|
||||
"rest",
|
||||
SyntaxShape::String,
|
||||
"the names to give columns once pivoted",
|
||||
)
|
||||
|
@ -13,7 +13,11 @@ impl WholeStreamCommand for Reject {
|
||||
}
|
||||
|
||||
fn signature(&self) -> Signature {
|
||||
Signature::build("reject").rest(SyntaxShape::String, "the names of columns to remove")
|
||||
Signature::build("reject").rest(
|
||||
"rest",
|
||||
SyntaxShape::String,
|
||||
"the names of columns to remove",
|
||||
)
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
|
@ -19,7 +19,11 @@ impl WholeStreamCommand for Rename {
|
||||
SyntaxShape::String,
|
||||
"the new name for the first column",
|
||||
)
|
||||
.rest(SyntaxShape::String, "the new name for additional columns")
|
||||
.rest(
|
||||
"rest",
|
||||
SyntaxShape::String,
|
||||
"the new name for additional columns",
|
||||
)
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
|
@ -17,6 +17,7 @@ impl WholeStreamCommand for Command {
|
||||
|
||||
fn signature(&self) -> Signature {
|
||||
Signature::build("rotate").rest(
|
||||
"rest",
|
||||
SyntaxShape::String,
|
||||
"the names to give columns once rotated",
|
||||
)
|
||||
|
@ -17,6 +17,7 @@ impl WholeStreamCommand for SubCommand {
|
||||
|
||||
fn signature(&self) -> Signature {
|
||||
Signature::build("rotate counter-clockwise").rest(
|
||||
"rest",
|
||||
SyntaxShape::String,
|
||||
"the names to give columns once rotated",
|
||||
)
|
||||
|
@ -16,6 +16,7 @@ impl WholeStreamCommand for Command {
|
||||
|
||||
fn signature(&self) -> Signature {
|
||||
Signature::build("select").rest(
|
||||
"rest",
|
||||
SyntaxShape::ColumnPath,
|
||||
"the columns to select from the table",
|
||||
)
|
||||
|
@ -21,7 +21,7 @@ impl WholeStreamCommand for SortBy {
|
||||
Some('i'),
|
||||
)
|
||||
.switch("reverse", "Sort in reverse order", Some('r'))
|
||||
.rest(SyntaxShape::String, "the column(s) to sort by")
|
||||
.rest("rest", SyntaxShape::String, "the column(s) to sort by")
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
|
@ -45,6 +45,7 @@ impl WholeStreamCommand for SubCommand {
|
||||
"decode the input from base64",
|
||||
Some('d'))
|
||||
.rest(
|
||||
"rest",
|
||||
SyntaxShape::ColumnPath,
|
||||
"optionally base64 encode / decode data by column paths",
|
||||
)
|
||||
|
@ -12,6 +12,7 @@ impl WholeStreamCommand for Command {
|
||||
|
||||
fn signature(&self) -> Signature {
|
||||
Signature::build("hash").rest(
|
||||
"rest",
|
||||
SyntaxShape::ColumnPath,
|
||||
"optionally convert by column paths",
|
||||
)
|
||||
|
@ -38,6 +38,7 @@ where
|
||||
|
||||
fn signature(&self) -> Signature {
|
||||
Signature::build(self.name()).rest(
|
||||
"rest",
|
||||
SyntaxShape::ColumnPath,
|
||||
format!("optionally {} encode data by column paths", D::name()),
|
||||
)
|
||||
|
@ -15,7 +15,7 @@ impl WholeStreamCommand for Seq {
|
||||
|
||||
fn signature(&self) -> Signature {
|
||||
Signature::build("seq")
|
||||
.rest(SyntaxShape::Number, "sequence values")
|
||||
.rest("rest", SyntaxShape::Number, "sequence values")
|
||||
.named(
|
||||
"separator",
|
||||
SyntaxShape::String,
|
||||
|
@ -14,8 +14,11 @@ impl WholeStreamCommand for UrlHost {
|
||||
}
|
||||
|
||||
fn signature(&self) -> Signature {
|
||||
Signature::build("url host")
|
||||
.rest(SyntaxShape::ColumnPath, "optionally operate by column path")
|
||||
Signature::build("url host").rest(
|
||||
"rest",
|
||||
SyntaxShape::ColumnPath,
|
||||
"optionally operate by column path",
|
||||
)
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
|
@ -14,8 +14,11 @@ impl WholeStreamCommand for UrlPath {
|
||||
}
|
||||
|
||||
fn signature(&self) -> Signature {
|
||||
Signature::build("url path")
|
||||
.rest(SyntaxShape::ColumnPath, "optionally operate by column path")
|
||||
Signature::build("url path").rest(
|
||||
"rest",
|
||||
SyntaxShape::ColumnPath,
|
||||
"optionally operate by column path",
|
||||
)
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
|
@ -14,8 +14,11 @@ impl WholeStreamCommand for UrlQuery {
|
||||
}
|
||||
|
||||
fn signature(&self) -> Signature {
|
||||
Signature::build("url query")
|
||||
.rest(SyntaxShape::ColumnPath, "optionally operate by column path")
|
||||
Signature::build("url query").rest(
|
||||
"rest",
|
||||
SyntaxShape::ColumnPath,
|
||||
"optionally operate by column path",
|
||||
)
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
|
@ -14,7 +14,11 @@ impl WholeStreamCommand for UrlScheme {
|
||||
}
|
||||
|
||||
fn signature(&self) -> Signature {
|
||||
Signature::build("url scheme").rest(SyntaxShape::ColumnPath, "optionally operate by path")
|
||||
Signature::build("url scheme").rest(
|
||||
"rest",
|
||||
SyntaxShape::ColumnPath,
|
||||
"optionally operate by path",
|
||||
)
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
|
@ -26,7 +26,11 @@ impl WholeStreamCommand for PathBasename {
|
||||
|
||||
fn signature(&self) -> Signature {
|
||||
Signature::build("path basename")
|
||||
.rest(SyntaxShape::ColumnPath, "Optionally operate by column path")
|
||||
.rest(
|
||||
"rest",
|
||||
SyntaxShape::ColumnPath,
|
||||
"Optionally operate by column path",
|
||||
)
|
||||
.named(
|
||||
"replace",
|
||||
SyntaxShape::String,
|
||||
|
@ -27,7 +27,11 @@ impl WholeStreamCommand for PathDirname {
|
||||
|
||||
fn signature(&self) -> Signature {
|
||||
Signature::build("path dirname")
|
||||
.rest(SyntaxShape::ColumnPath, "Optionally operate by column path")
|
||||
.rest(
|
||||
"rest",
|
||||
SyntaxShape::ColumnPath,
|
||||
"Optionally operate by column path",
|
||||
)
|
||||
.named(
|
||||
"replace",
|
||||
SyntaxShape::String,
|
||||
|
@ -23,8 +23,11 @@ impl WholeStreamCommand for PathExists {
|
||||
}
|
||||
|
||||
fn signature(&self) -> Signature {
|
||||
Signature::build("path exists")
|
||||
.rest(SyntaxShape::ColumnPath, "Optionally operate by column path")
|
||||
Signature::build("path exists").rest(
|
||||
"rest",
|
||||
SyntaxShape::ColumnPath,
|
||||
"Optionally operate by column path",
|
||||
)
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
|
@ -32,7 +32,11 @@ impl WholeStreamCommand for PathExpand {
|
||||
"Throw an error if the path could not be expanded",
|
||||
Some('s'),
|
||||
)
|
||||
.rest(SyntaxShape::ColumnPath, "Optionally operate by column path")
|
||||
.rest(
|
||||
"rest",
|
||||
SyntaxShape::ColumnPath,
|
||||
"Optionally operate by column path",
|
||||
)
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
|
@ -26,7 +26,11 @@ impl WholeStreamCommand for PathJoin {
|
||||
|
||||
fn signature(&self) -> Signature {
|
||||
Signature::build("path join")
|
||||
.rest(SyntaxShape::ColumnPath, "Optionally operate by column path")
|
||||
.rest(
|
||||
"rest",
|
||||
SyntaxShape::ColumnPath,
|
||||
"Optionally operate by column path",
|
||||
)
|
||||
.named(
|
||||
"append",
|
||||
SyntaxShape::FilePath,
|
||||
|
@ -28,7 +28,11 @@ impl WholeStreamCommand for PathParse {
|
||||
|
||||
fn signature(&self) -> Signature {
|
||||
Signature::build("path parse")
|
||||
.rest(SyntaxShape::ColumnPath, "Optionally operate by column path")
|
||||
.rest(
|
||||
"rest",
|
||||
SyntaxShape::ColumnPath,
|
||||
"Optionally operate by column path",
|
||||
)
|
||||
.named(
|
||||
"extension",
|
||||
SyntaxShape::String,
|
||||
|
@ -31,7 +31,11 @@ impl WholeStreamCommand for PathRelativeTo {
|
||||
SyntaxShape::FilePath,
|
||||
"Parent shared with the input path",
|
||||
)
|
||||
.rest(SyntaxShape::ColumnPath, "Optionally operate by column path")
|
||||
.rest(
|
||||
"rest",
|
||||
SyntaxShape::ColumnPath,
|
||||
"Optionally operate by column path",
|
||||
)
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
|
@ -23,8 +23,11 @@ impl WholeStreamCommand for PathSplit {
|
||||
}
|
||||
|
||||
fn signature(&self) -> Signature {
|
||||
Signature::build("path split")
|
||||
.rest(SyntaxShape::ColumnPath, "Optionally operate by column path")
|
||||
Signature::build("path split").rest(
|
||||
"rest",
|
||||
SyntaxShape::ColumnPath,
|
||||
"Optionally operate by column path",
|
||||
)
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
|
@ -24,8 +24,11 @@ impl WholeStreamCommand for PathType {
|
||||
}
|
||||
|
||||
fn signature(&self) -> Signature {
|
||||
Signature::build("path type")
|
||||
.rest(SyntaxShape::ColumnPath, "Optionally operate by column path")
|
||||
Signature::build("path type").rest(
|
||||
"rest",
|
||||
SyntaxShape::ColumnPath,
|
||||
"Optionally operate by column path",
|
||||
)
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
|
@ -40,6 +40,7 @@ impl WholeStreamCommand for SubCommand {
|
||||
Some('d'),
|
||||
)
|
||||
.rest(
|
||||
"rest",
|
||||
SyntaxShape::ColumnPath,
|
||||
"optionally, draw gradients using text from column paths",
|
||||
)
|
||||
|
@ -15,6 +15,7 @@ impl WholeStreamCommand for SubCommand {
|
||||
|
||||
fn signature(&self) -> Signature {
|
||||
Signature::build("ansi strip").rest(
|
||||
"rest",
|
||||
SyntaxShape::ColumnPath,
|
||||
"optionally, remove ansi sequences by column paths",
|
||||
)
|
||||
|
@ -25,6 +25,7 @@ impl WholeStreamCommand for Exec {
|
||||
Signature::build("exec")
|
||||
.required("command", SyntaxShape::FilePath, "the command to execute")
|
||||
.rest(
|
||||
"rest",
|
||||
SyntaxShape::GlobPattern,
|
||||
"any additional arguments for the command",
|
||||
)
|
||||
|
@ -19,7 +19,7 @@ impl WholeStreamCommand for Kill {
|
||||
SyntaxShape::Int,
|
||||
"process id of process that is to be killed",
|
||||
)
|
||||
.rest(SyntaxShape::Int, "rest of processes to kill")
|
||||
.rest("rest", SyntaxShape::Int, "rest of processes to kill")
|
||||
.switch("force", "forcefully kill the process", Some('f'))
|
||||
.switch("quiet", "won't print anything to the console", Some('q'));
|
||||
|
||||
|
@ -43,7 +43,7 @@ impl WholeStreamCommand for RunExternalCommand {
|
||||
}
|
||||
|
||||
fn signature(&self) -> Signature {
|
||||
Signature::build(self.name()).rest(SyntaxShape::Any, "external command arguments")
|
||||
Signature::build(self.name()).rest("rest", SyntaxShape::Any, "external command arguments")
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
|
@ -21,7 +21,7 @@ impl WholeStreamCommand for Sleep {
|
||||
fn signature(&self) -> Signature {
|
||||
Signature::build("sleep")
|
||||
.required("duration", SyntaxShape::Duration, "time to sleep")
|
||||
.rest(SyntaxShape::Duration, "additional time")
|
||||
.rest("rest", SyntaxShape::Duration, "additional time")
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
|
@ -16,7 +16,7 @@ impl WholeStreamCommand for Which {
|
||||
fn signature(&self) -> Signature {
|
||||
Signature::build("which")
|
||||
.required("application", SyntaxShape::String, "application")
|
||||
.rest(SyntaxShape::String, "additional applications")
|
||||
.rest("rest", SyntaxShape::String, "additional applications")
|
||||
.switch("all", "list all executables", Some('a'))
|
||||
}
|
||||
|
||||
|
@ -13,8 +13,11 @@ impl WholeStreamCommand for BuildString {
|
||||
}
|
||||
|
||||
fn signature(&self) -> Signature {
|
||||
Signature::build("build-string")
|
||||
.rest(SyntaxShape::Any, "all values to form into the string")
|
||||
Signature::build("build-string").rest(
|
||||
"rest",
|
||||
SyntaxShape::Any,
|
||||
"all values to form into the string",
|
||||
)
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
|
@ -135,7 +135,7 @@ impl WholeStreamCommand for Char {
|
||||
SyntaxShape::Any,
|
||||
"the name of the character to output",
|
||||
)
|
||||
.rest(SyntaxShape::String, "multiple Unicode bytes")
|
||||
.rest("rest", SyntaxShape::String, "multiple Unicode bytes")
|
||||
.switch("list", "List all supported character names", Some('l'))
|
||||
.switch("unicode", "Unicode string i.e. 1f378", Some('u'))
|
||||
}
|
||||
|
@ -22,7 +22,11 @@ impl WholeStreamCommand for SubCommand {
|
||||
"the character that denotes what separates columns",
|
||||
)
|
||||
.switch("collapse-empty", "remove empty columns", Some('c'))
|
||||
.rest(SyntaxShape::String, "column names to give the new columns")
|
||||
.rest(
|
||||
"rest",
|
||||
SyntaxShape::String,
|
||||
"column names to give the new columns",
|
||||
)
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
|
@ -19,6 +19,7 @@ impl WholeStreamCommand for SubCommand {
|
||||
|
||||
fn signature(&self) -> Signature {
|
||||
Signature::build("str capitalize").rest(
|
||||
"rest",
|
||||
SyntaxShape::ColumnPath,
|
||||
"optionally capitalize text by column paths",
|
||||
)
|
||||
|
@ -14,6 +14,7 @@ impl WholeStreamCommand for SubCommand {
|
||||
|
||||
fn signature(&self) -> Signature {
|
||||
Signature::build("str camel-case").rest(
|
||||
"rest",
|
||||
SyntaxShape::ColumnPath,
|
||||
"optionally convert text to camelCase by column paths",
|
||||
)
|
||||
|
@ -14,6 +14,7 @@ impl WholeStreamCommand for SubCommand {
|
||||
|
||||
fn signature(&self) -> Signature {
|
||||
Signature::build("str kebab-case").rest(
|
||||
"rest",
|
||||
SyntaxShape::ColumnPath,
|
||||
"optionally convert text to kebab-case by column paths",
|
||||
)
|
||||
|
@ -14,6 +14,7 @@ impl WholeStreamCommand for SubCommand {
|
||||
|
||||
fn signature(&self) -> Signature {
|
||||
Signature::build("str pascal-case").rest(
|
||||
"rest",
|
||||
SyntaxShape::ColumnPath,
|
||||
"optionally convert text to PascalCase by column paths",
|
||||
)
|
||||
|
@ -14,6 +14,7 @@ impl WholeStreamCommand for SubCommand {
|
||||
|
||||
fn signature(&self) -> Signature {
|
||||
Signature::build("str screaming-snake-case").rest(
|
||||
"rest",
|
||||
SyntaxShape::ColumnPath,
|
||||
"optionally convert text to SCREAMING_SNAKE_CASE by column paths",
|
||||
)
|
||||
|
@ -14,6 +14,7 @@ impl WholeStreamCommand for SubCommand {
|
||||
|
||||
fn signature(&self) -> Signature {
|
||||
Signature::build("str snake-case").rest(
|
||||
"rest",
|
||||
SyntaxShape::ColumnPath,
|
||||
"optionally convert text to snake_case by column paths",
|
||||
)
|
||||
|
@ -12,6 +12,7 @@ impl WholeStreamCommand for Command {
|
||||
|
||||
fn signature(&self) -> Signature {
|
||||
Signature::build("str").rest(
|
||||
"rest",
|
||||
SyntaxShape::ColumnPath,
|
||||
"optionally convert by column paths",
|
||||
)
|
||||
|
@ -25,6 +25,7 @@ impl WholeStreamCommand for SubCommand {
|
||||
Signature::build("str contains")
|
||||
.required("pattern", SyntaxShape::String, "the pattern to find")
|
||||
.rest(
|
||||
"rest",
|
||||
SyntaxShape::ColumnPath,
|
||||
"optionally check if string contains pattern by column paths",
|
||||
)
|
||||
|
@ -21,6 +21,7 @@ impl WholeStreamCommand for SubCommand {
|
||||
|
||||
fn signature(&self) -> Signature {
|
||||
Signature::build("str downcase").rest(
|
||||
"rest",
|
||||
SyntaxShape::ColumnPath,
|
||||
"optionally downcase text by column paths",
|
||||
)
|
||||
|
@ -24,6 +24,7 @@ impl WholeStreamCommand for SubCommand {
|
||||
Signature::build("str ends-with")
|
||||
.required("pattern", SyntaxShape::String, "the pattern to match")
|
||||
.rest(
|
||||
"rest",
|
||||
SyntaxShape::ColumnPath,
|
||||
"optionally matches suffix of text by column paths",
|
||||
)
|
||||
|
@ -28,6 +28,7 @@ impl WholeStreamCommand for SubCommand {
|
||||
.required("find", SyntaxShape::String, "the pattern to find")
|
||||
.required("replace", SyntaxShape::String, "the replacement pattern")
|
||||
.rest(
|
||||
"rest",
|
||||
SyntaxShape::ColumnPath,
|
||||
"optionally find and replace text by column paths",
|
||||
)
|
||||
|
@ -33,6 +33,7 @@ impl WholeStreamCommand for SubCommand {
|
||||
"the pattern to find index of",
|
||||
)
|
||||
.rest(
|
||||
"rest",
|
||||
SyntaxShape::ColumnPath,
|
||||
"optionally returns index of pattern in string by column paths",
|
||||
)
|
||||
|
@ -19,6 +19,7 @@ impl WholeStreamCommand for SubCommand {
|
||||
|
||||
fn signature(&self) -> Signature {
|
||||
Signature::build("str length").rest(
|
||||
"rest",
|
||||
SyntaxShape::ColumnPath,
|
||||
"optionally find length of text by column paths",
|
||||
)
|
||||
|
@ -31,6 +31,7 @@ impl WholeStreamCommand for SubCommand {
|
||||
Some('c'),
|
||||
)
|
||||
.rest(
|
||||
"rest",
|
||||
SyntaxShape::ColumnPath,
|
||||
"optionally check if string contains pattern by column paths",
|
||||
)
|
||||
|
@ -19,6 +19,7 @@ impl WholeStreamCommand for SubCommand {
|
||||
|
||||
fn signature(&self) -> Signature {
|
||||
Signature::build("str reverse").rest(
|
||||
"rest",
|
||||
SyntaxShape::ColumnPath,
|
||||
"optionally reverse text by column paths",
|
||||
)
|
||||
|
@ -31,6 +31,7 @@ impl WholeStreamCommand for SubCommand {
|
||||
Some('c'),
|
||||
)
|
||||
.rest(
|
||||
"rest",
|
||||
SyntaxShape::ColumnPath,
|
||||
"optionally check if string contains pattern by column paths",
|
||||
)
|
||||
|
@ -24,6 +24,7 @@ impl WholeStreamCommand for SubCommand {
|
||||
Signature::build("str starts-with")
|
||||
.required("pattern", SyntaxShape::String, "the pattern to match")
|
||||
.rest(
|
||||
"rest",
|
||||
SyntaxShape::ColumnPath,
|
||||
"optionally matches prefix of text by column paths",
|
||||
)
|
||||
|
@ -31,6 +31,7 @@ impl WholeStreamCommand for SubCommand {
|
||||
"the indexes to substring [start end]",
|
||||
)
|
||||
.rest(
|
||||
"rest",
|
||||
SyntaxShape::ColumnPath,
|
||||
"optionally substring text by column paths",
|
||||
)
|
||||
|
@ -77,6 +77,7 @@ impl WholeStreamCommand for SubCommand {
|
||||
Some('f'),
|
||||
)
|
||||
.rest(
|
||||
"rest",
|
||||
SyntaxShape::Any,
|
||||
"optionally convert text into datetime by column paths",
|
||||
)
|
||||
|
@ -24,6 +24,7 @@ impl WholeStreamCommand for SubCommand {
|
||||
|
||||
fn signature(&self) -> Signature {
|
||||
Signature::build("str to-decimal").rest(
|
||||
"rest",
|
||||
SyntaxShape::ColumnPath,
|
||||
"optionally convert text into decimal by column paths",
|
||||
)
|
||||
|
@ -24,6 +24,7 @@ impl WholeStreamCommand for SubCommand {
|
||||
Signature::build("str to-int")
|
||||
.named("radix", SyntaxShape::Number, "radix of integer", Some('r'))
|
||||
.rest(
|
||||
"rest",
|
||||
SyntaxShape::ColumnPath,
|
||||
"optionally convert text into integer by column paths",
|
||||
)
|
||||
|
@ -14,6 +14,7 @@ impl WholeStreamCommand for SubCommand {
|
||||
fn signature(&self) -> Signature {
|
||||
Signature::build("str trim")
|
||||
.rest(
|
||||
"rest",
|
||||
SyntaxShape::ColumnPath,
|
||||
"optionally trim text by column paths",
|
||||
)
|
||||
|
@ -21,6 +21,7 @@ impl WholeStreamCommand for SubCommand {
|
||||
|
||||
fn signature(&self) -> Signature {
|
||||
Signature::build("str upcase").rest(
|
||||
"rest",
|
||||
SyntaxShape::ColumnPath,
|
||||
"optionally upcase text by column paths",
|
||||
)
|
||||
|
@ -20,7 +20,7 @@ impl WholeStreamCommand for Command {
|
||||
}
|
||||
|
||||
fn signature(&self) -> Signature {
|
||||
Signature::build("echo").rest(SyntaxShape::Any, "the values to echo")
|
||||
Signature::build("echo").rest("rest", SyntaxShape::Any, "the values to echo")
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
|
Reference in New Issue
Block a user