From 3435787dfb520cd0e01478364bbd58e49f673dc3 Mon Sep 17 00:00:00 2001 From: 132ikl <132@ikl.sh> Date: Sun, 13 Apr 2025 12:59:59 -0400 Subject: [PATCH 1/3] Run prettier --- lang-guide/chapters/pipelines.md | 143 ++++++++++++++++--------------- 1 file changed, 72 insertions(+), 71 deletions(-) diff --git a/lang-guide/chapters/pipelines.md b/lang-guide/chapters/pipelines.md index e6a715c561c..c88439b3b51 100644 --- a/lang-guide/chapters/pipelines.md +++ b/lang-guide/chapters/pipelines.md @@ -84,80 +84,81 @@ Also note that `complete` is special, it doesn't work with `e>|`, `o+e>|`. ## Stdio and redirection behavior examples -Pipeline and redirection behavior can be hard to follow when they are used with subexpressions, or custom commands. Here are some examples that show intended stdio behavior. +Pipeline and redirection behavior can be hard to follow when they are used with subexpressions, or custom commands. Here are some examples that show intended stdio behavior. ### Examples for subexpression - (^cmd1 | ^cmd2; ^cmd3 | ^cmd4) -| Command | Stdout | Stderr | -| ------- | -------- | ---------- | -| cmd1 | Piped | Terminal | -| cmd2 | *Terminal* | Terminal | -| cmd3 | Piped | Terminal | -| cmd4 | Terminal | Terminal | +| Command | Stdout | Stderr | +| ------- | ---------- | -------- | +| cmd1 | Piped | Terminal | +| cmd2 | _Terminal_ | Terminal | +| cmd3 | Piped | Terminal | +| cmd4 | Terminal | Terminal | - (^cmd1 | ^cmd2; ^cmd3 | ^cmd4) | ^cmd5 -It runs `(^cmd1 | ^cmd2; ^cmd3 | ^cmd4)` first, then pipes *stdout* to `^cmd5`, where both stdout and stderr are directed to the Terminal. +It runs `(^cmd1 | ^cmd2; ^cmd3 | ^cmd4)` first, then pipes _stdout_ to `^cmd5`, where both stdout and stderr are directed to the Terminal. -| Command | Stdout | Stderr | -| ------- | -------- | ---------- | -| cmd1 | Piped | Terminal | -| cmd2 | *Terminal* | Terminal | -| cmd3 | Piped | Terminal | -| cmd4 | Piped | Terminal | +| Command | Stdout | Stderr | +| ------- | ---------- | -------- | +| cmd1 | Piped | Terminal | +| cmd2 | _Terminal_ | Terminal | +| cmd3 | Piped | Terminal | +| cmd4 | Piped | Terminal | - (^cmd1 | ^cmd2; ^cmd3 | ^cmd4) e>| ^cmd5 -It runs `(^cmd1 | ^cmd2; ^cmd3 | ^cmd4)` first, then pipes *stderr* to `^cmd5`, where both stdout and stderr are directed to the Terminal. +It runs `(^cmd1 | ^cmd2; ^cmd3 | ^cmd4)` first, then pipes _stderr_ to `^cmd5`, where both stdout and stderr are directed to the Terminal. | Command | Stdout | Stderr | | ------- | -------- | -------- | | cmd1 | Piped | Terminal | | cmd2 | Terminal | Terminal | | cmd3 | Piped | Terminal | -| cmd4 | Terminal | Piped | +| cmd4 | Terminal | Piped | - (^cmd1 | ^cmd2; ^cmd3 | ^cmd4) o+e>| ^cmd5 -It runs `(^cmd1 | ^cmd2; ^cmd3 | ^cmd4)` first, then pipes *stdout and stderr* to `^cmd5`, where both stdout and stderr are directed to the Terminal. +It runs `(^cmd1 | ^cmd2; ^cmd3 | ^cmd4)` first, then pipes _stdout and stderr_ to `^cmd5`, where both stdout and stderr are directed to the Terminal. | Command | Stdout | Stderr | | ------- | -------- | -------- | | cmd1 | Piped | Terminal | | cmd2 | Terminal | Terminal | | cmd3 | Piped | Terminal | -| cmd4 | Piped | Piped | +| cmd4 | Piped | Piped | - (^cmd1 | ^cmd2; ^cmd3 | ^cmd4) o> test.out -| Command | Stdout | Stderr | -| ------- | -------- | -------- | -| cmd1 | Piped | Terminal | -| cmd2 | File | Terminal | -| cmd3 | Piped | Terminal | -| cmd4 | File | Terminal | +| Command | Stdout | Stderr | +| ------- | ------ | -------- | +| cmd1 | Piped | Terminal | +| cmd2 | File | Terminal | +| cmd3 | Piped | Terminal | +| cmd4 | File | Terminal | - (^cmd1 | ^cmd2; ^cmd3 | ^cmd4) e> test.out -| Command | Stdout | Stderr | -| ------- | -------- | -------- | -| cmd1 | Piped | File | -| cmd2 | Terminal | File | -| cmd3 | Piped | File | -| cmd4 | Terminal | File | +| Command | Stdout | Stderr | +| ------- | -------- | ------ | +| cmd1 | Piped | File | +| cmd2 | Terminal | File | +| cmd3 | Piped | File | +| cmd4 | Terminal | File | - (^cmd1 | ^cmd2; ^cmd3 | ^cmd4) o+e> test.out -| Command | Stdout | Stderr | -| ------- | -------- | -------- | -| cmd1 | Piped | File | -| cmd2 | File | File | -| cmd3 | Piped | File | -| cmd4 | File | File | +| Command | Stdout | Stderr | +| ------- | ------ | ------ | +| cmd1 | Piped | File | +| cmd2 | File | File | +| cmd3 | Piped | File | +| cmd4 | File | File | ### Examples for custom command + Given the following custom commands ```nu @@ -173,69 +174,69 @@ In the examples below the body of `custom-cmd` is `(^cmd1 | ^cmd2; ^cmd3 | ^cmd4 - custom-cmd -| Command | Stdout | Stderr | -| ------- | -------- | ---------- | -| cmd1 | Piped | Terminal | -| cmd2 | *Terminal* | Terminal | -| cmd3 | Piped | Terminal | -| cmd4 | Terminal | Terminal | +| Command | Stdout | Stderr | +| ------- | ---------- | -------- | +| cmd1 | Piped | Terminal | +| cmd2 | _Terminal_ | Terminal | +| cmd3 | Piped | Terminal | +| cmd4 | Terminal | Terminal | - custom-cmd | ^cmd5 -It runs `custom-cmd` first, then pipes *stdout* to `^cmd5`, where both stdout and stderr are directed to the Terminal. +It runs `custom-cmd` first, then pipes _stdout_ to `^cmd5`, where both stdout and stderr are directed to the Terminal. -| Command | Stdout | Stderr | -| ------- | -------- | ---------- | -| cmd1 | Piped | Terminal | -| cmd2 | *Terminal* | Terminal | -| cmd3 | Piped | Terminal | -| cmd4 | Piped | Terminal | +| Command | Stdout | Stderr | +| ------- | ---------- | -------- | +| cmd1 | Piped | Terminal | +| cmd2 | _Terminal_ | Terminal | +| cmd3 | Piped | Terminal | +| cmd4 | Piped | Terminal | - custom-cmd e>| ^cmd5 -It runs `custom-cmd` first, then pipes *stderr* to `^cmd5`, where both stdout and stderr are directed to the Terminal. +It runs `custom-cmd` first, then pipes _stderr_ to `^cmd5`, where both stdout and stderr are directed to the Terminal. | Command | Stdout | Stderr | | ------- | -------- | -------- | | cmd1 | Piped | Terminal | | cmd2 | Terminal | Terminal | | cmd3 | Piped | Terminal | -| cmd4 | Terminal | Piped | +| cmd4 | Terminal | Piped | - custom-cmd o+e>| ^cmd5 -It runs `custom-cmd` first, then pipes *stdout and stderr* to `^cmd5`, where both stdout and stderr are directed to the Terminal. +It runs `custom-cmd` first, then pipes _stdout and stderr_ to `^cmd5`, where both stdout and stderr are directed to the Terminal. | Command | Stdout | Stderr | | ------- | -------- | -------- | | cmd1 | Piped | Terminal | | cmd2 | Terminal | Terminal | | cmd3 | Piped | Terminal | -| cmd4 | Piped | Piped | +| cmd4 | Piped | Piped | - custom-cmd o> test.out -| Command | Stdout | Stderr | -| ------- | -------- | -------- | -| cmd1 | Piped | Terminal | -| cmd2 | File | Terminal | -| cmd3 | Piped | Terminal | -| cmd4 | File | Terminal | +| Command | Stdout | Stderr | +| ------- | ------ | -------- | +| cmd1 | Piped | Terminal | +| cmd2 | File | Terminal | +| cmd3 | Piped | Terminal | +| cmd4 | File | Terminal | - custom-cmd e> test.out -| Command | Stdout | Stderr | -| ------- | -------- | -------- | -| cmd1 | Piped | File | -| cmd2 | Terminal | File | -| cmd3 | Piped | File | -| cmd4 | Terminal | File | +| Command | Stdout | Stderr | +| ------- | -------- | ------ | +| cmd1 | Piped | File | +| cmd2 | Terminal | File | +| cmd3 | Piped | File | +| cmd4 | Terminal | File | - custom-cmd o+e> test.out -| Command | Stdout | Stderr | -| ------- | -------- | -------- | -| cmd1 | Piped | File | -| cmd2 | File | File | -| cmd3 | Piped | File | -| cmd4 | File | File | +| Command | Stdout | Stderr | +| ------- | ------ | ------ | +| cmd1 | Piped | File | +| cmd2 | File | File | +| cmd3 | Piped | File | +| cmd4 | File | File | From a6b2b4def8668fda787f5989ee02ede86c9cd721 Mon Sep 17 00:00:00 2001 From: 132ikl <132@ikl.sh> Date: Sun, 13 Apr 2025 13:00:18 -0400 Subject: [PATCH 2/3] Add note about issue #15326 --- lang-guide/chapters/pipelines.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lang-guide/chapters/pipelines.md b/lang-guide/chapters/pipelines.md index c88439b3b51..ddc0e6a54b4 100644 --- a/lang-guide/chapters/pipelines.md +++ b/lang-guide/chapters/pipelines.md @@ -119,6 +119,12 @@ It runs `(^cmd1 | ^cmd2; ^cmd3 | ^cmd4)` first, then pipes _stderr_ to `^cmd5`, | cmd3 | Piped | Terminal | | cmd4 | Terminal | Piped | +::: warning + +Please note that the following 3 examples are currently broken due to a regression documented [issue #15326](https://github.com/nushell/nushell/issues/15326). + +::: + - (^cmd1 | ^cmd2; ^cmd3 | ^cmd4) o+e>| ^cmd5 It runs `(^cmd1 | ^cmd2; ^cmd3 | ^cmd4)` first, then pipes _stdout and stderr_ to `^cmd5`, where both stdout and stderr are directed to the Terminal. From d5d3f4d03387ef4800e3311bc513ed85898c8815 Mon Sep 17 00:00:00 2001 From: 132ikl <132@ikl.sh> Date: Sun, 13 Apr 2025 13:06:32 -0400 Subject: [PATCH 3/3] Fix position of warning --- lang-guide/chapters/pipelines.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lang-guide/chapters/pipelines.md b/lang-guide/chapters/pipelines.md index ddc0e6a54b4..6aafb1cd0f7 100644 --- a/lang-guide/chapters/pipelines.md +++ b/lang-guide/chapters/pipelines.md @@ -119,12 +119,6 @@ It runs `(^cmd1 | ^cmd2; ^cmd3 | ^cmd4)` first, then pipes _stderr_ to `^cmd5`, | cmd3 | Piped | Terminal | | cmd4 | Terminal | Piped | -::: warning - -Please note that the following 3 examples are currently broken due to a regression documented [issue #15326](https://github.com/nushell/nushell/issues/15326). - -::: - - (^cmd1 | ^cmd2; ^cmd3 | ^cmd4) o+e>| ^cmd5 It runs `(^cmd1 | ^cmd2; ^cmd3 | ^cmd4)` first, then pipes _stdout and stderr_ to `^cmd5`, where both stdout and stderr are directed to the Terminal. @@ -136,6 +130,12 @@ It runs `(^cmd1 | ^cmd2; ^cmd3 | ^cmd4)` first, then pipes _stdout and stderr_ t | cmd3 | Piped | Terminal | | cmd4 | Piped | Piped | +::: warning + +Please note that the following 3 examples are currently broken due to a regression documented [issue #15326](https://github.com/nushell/nushell/issues/15326). + +::: + - (^cmd1 | ^cmd2; ^cmd3 | ^cmd4) o> test.out | Command | Stdout | Stderr |