forked from extern/nushell
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:
@ -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'))
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user