mirror of
https://github.com/nushell/nushell.git
synced 2025-01-11 00:38:23 +01:00
Backport fixes from nushell/nushell.github.io#633 (#6712)
Co-authored-by: Eric Hodel <drbrain@segment7.net> Co-authored-by: Eric Hodel <drbrain@segment7.net>
This commit is contained in:
parent
5815f122ed
commit
d40a73aafe
@ -33,8 +33,8 @@ impl Command for External {
|
|||||||
|
|
||||||
fn signature(&self) -> nu_protocol::Signature {
|
fn signature(&self) -> nu_protocol::Signature {
|
||||||
Signature::build(self.name())
|
Signature::build(self.name())
|
||||||
.switch("redirect-stdout", "redirect-stdout", None)
|
.switch("redirect-stdout", "redirect stdout to the pipeline", None)
|
||||||
.switch("redirect-stderr", "redirect-stderr", None)
|
.switch("redirect-stderr", "redirect stderr to the pipeline", None)
|
||||||
.required("command", SyntaxShape::Any, "external command to run")
|
.required("command", SyntaxShape::Any, "external command to run")
|
||||||
.rest("args", SyntaxShape::Any, "arguments for external command")
|
.rest("args", SyntaxShape::Any, "arguments for external command")
|
||||||
.category(Category::System)
|
.category(Category::System)
|
||||||
@ -113,11 +113,18 @@ impl Command for External {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn examples(&self) -> Vec<Example> {
|
fn examples(&self) -> Vec<Example> {
|
||||||
vec![Example {
|
vec![
|
||||||
description: "Run an external command",
|
Example {
|
||||||
example: r#"run-external "echo" "-n" "hello""#,
|
description: "Run an external command",
|
||||||
result: None,
|
example: r#"run-external "echo" "-n" "hello""#,
|
||||||
}]
|
result: None,
|
||||||
|
},
|
||||||
|
Example {
|
||||||
|
description: "Redirect stdout from an external command into the pipeline",
|
||||||
|
example: r#"run-external --redirect-stdout "echo" "-n" "hello" | split chars"#,
|
||||||
|
result: None,
|
||||||
|
},
|
||||||
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user