From d40a73aafeeca50d4c7cb4b5e34eed5f26bba36f Mon Sep 17 00:00:00 2001 From: Stefan Holderbach Date: Wed, 12 Oct 2022 19:14:16 +0200 Subject: [PATCH] Backport fixes from nushell/nushell.github.io#633 (#6712) Co-authored-by: Eric Hodel Co-authored-by: Eric Hodel --- crates/nu-command/src/system/run_external.rs | 21 +++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/crates/nu-command/src/system/run_external.rs b/crates/nu-command/src/system/run_external.rs index 8c4f3df3b8..5e5b9adf6e 100644 --- a/crates/nu-command/src/system/run_external.rs +++ b/crates/nu-command/src/system/run_external.rs @@ -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 { - 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, + }, + ] } }