mirror of
https://github.com/nushell/nushell.git
synced 2025-08-09 18:15:04 +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:
@ -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."
|
||||
|
Reference in New Issue
Block a user