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:
Stefan Holderbach 2022-10-12 19:14:16 +02:00 committed by GitHub
parent 5815f122ed
commit d40a73aafe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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,
},
]
} }
} }