nushell/tests
Wind 58c6fea60b
Support redirect stderr and stdout+stderr with a pipe (#11708)
# Description
Close: #9673
Close: #8277
Close: #10944

This pr introduces the following syntax:
1. `e>|`, pipe stderr to next command. Example: `$env.FOO=bar nu
--testbin echo_env_stderr FOO e>| str length`
2. `o+e>|` and `e+o>|`, pipe both stdout and stderr to next command,
example: `$env.FOO=bar nu --testbin echo_env_mixed out-err FOO FOO e+o>|
str length`

Note: it only works for external commands. ~There is no different for
internal commands, that is, the following three commands do the same
things:~ Edit: it raises errors if we want to pipes for internal
commands
``` 
❯ ls e>| str length
Error:   × `e>|` only works with external streams
   ╭─[entry #1:1:1]
 1 │ ls e>| str length
   ·    ─┬─
   ·     ╰── `e>|` only works on external streams
   ╰────

❯ ls e+o>| str length
Error:   × `o+e>|` only works with external streams
   ╭─[entry #2:1:1]
 1 │ ls e+o>| str length
   ·    ──┬──
   ·      ╰── `o+e>|` only works on external streams
   ╰────
```

This can help us to avoid some strange issues like the following:

`$env.FOO=bar (nu --testbin echo_env_stderr FOO) e>| str length`

Which is hard to understand and hard to explain to users.

# User-Facing Changes
Nan

# Tests + Formatting
To be done

# After Submitting
Maybe update documentation about these syntax.
2024-02-09 01:30:46 +08:00
..
assets/nu_json Remove old nushell/merge engine-q 2022-02-07 14:54:06 -05:00
const_ Evaluate string interpolation at parse time (#11562) 2024-01-22 09:13:48 +02:00
eval Exit early when encountering parsing errors (#10213) 2023-09-05 14:36:37 +02:00
fixtures Fix file completions which contains glob pattern (#11766) 2024-02-08 06:42:50 +08:00
hooks Auto-expand table based on terminal width (#9934) 2023-08-08 05:47:23 -05:00
modules Evaluate string interpolation at parse time (#11562) 2024-01-22 09:13:48 +02:00
overlays Fix overlay_use_main_not_exported hanging when an external spam command exists (#11261) 2023-12-08 06:08:38 -06:00
parsing Forbid reserved variable names for function arguments (#11169) 2023-11-29 18:29:07 +01:00
path change canonicalize test use a more deeply rooted folder (#10685) 2023-10-11 11:27:25 -05:00
plugins Plugin explicit flags (#11581) 2024-01-22 15:00:43 -06:00
scope add $.extra_usage to modules (#11649) 2024-01-27 17:49:21 +02:00
shell Support redirect stderr and stdout+stderr with a pipe (#11708) 2024-02-09 01:30:46 +08:00
main.rs prevent redefining fields in a record (#8705) 2023-04-02 06:09:33 +12:00