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 {
Signature::build(self.name())
.switch("redirect-stdout", "redirect-stdout", None)
.switch("redirect-stderr", "redirect-stderr", None)
.switch("redirect-stdout", "redirect stdout to the pipeline", None)
.switch("redirect-stderr", "redirect stderr to the pipeline", None)
.required("command", SyntaxShape::Any, "external command to run")
.rest("args", SyntaxShape::Any, "arguments for external command")
.category(Category::System)
@ -113,11 +113,18 @@ impl Command for External {
}
fn examples(&self) -> Vec<Example> {
vec![Example {
description: "Run an external command",
example: r#"run-external "echo" "-n" "hello""#,
result: None,
}]
vec![
Example {
description: "Run an external command",
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,
},
]
}
}