nushell/crates/nu-cli/src
Antoine Stevan 8403fff345
allow print to take data as input again (#9823)
related to
https://discord.com/channels/601130461678272522/601130461678272524/1134079115134251129

# Description
before 0.83.0, `print` used to allow piping data into it, e.g.
```nushell
"foo" | print
```
instead of 
```nushell
print "foo"
```

this PR enables the `any -> nothing` input / output type to allow this
again.

i've double checked and `print` is essentially the following snippet
```rust
        if !args.is_empty() {
            for arg in args {
                arg.into_pipeline_data()
                    .print(engine_state, stack, no_newline, to_stderr)?;
            }
        } else if !input.is_nothing() {
            input.print(engine_state, stack, no_newline, to_stderr)?;
        }
```
1. the first part is for `print a b c`
2. the second part is for `"foo" | print`

# User-Facing Changes
```nushell
"foo" | print
```
works again

# Tests + Formatting
- 🟢 `toolkit fmt`
- 🟢 `toolkit clippy`
-  `toolkit test`
-  `toolkit test stdlib`

# After Submitting

---------

Co-authored-by: sholderbach <sholderbach@users.noreply.github.com>
2023-07-27 21:40:25 +02:00
..
commands add more input_output_types found from breaking scripts (#9683) 2023-07-14 10:58:41 -05:00
completions Apply nightly clippy lints (#9654) 2023-07-12 00:00:31 +02:00
menus Add functions for each Value case (#9736) 2023-07-21 08:20:33 -05:00
config_files.rs Fix config creation during printing (#9353) 2023-06-04 22:04:28 +03:00
eval_cmds.rs Move CLI related commands to nu-cli (#8832) 2023-04-10 10:56:47 +12:00
eval_file.rs Remove broken compile-time overload system (#9677) 2023-07-14 07:05:03 +12:00
lib.rs cratification: move the bytes command to nu-cmd-extra (#9509) 2023-06-23 12:23:08 -07:00
nu_highlight.rs Box ShellError in Value::Error (#8375) 2023-03-12 09:57:27 +01:00
print.rs allow print to take data as input again (#9823) 2023-07-27 21:40:25 +02:00
prompt_update.rs remove nu_cli crate dependency from nu_std (#8807) 2023-04-08 13:53:43 +02:00
prompt.rs FIX: add a space after the default left prompt (#9074) 2023-05-08 13:00:44 -05:00
reedline_config.rs Add functions for each Value case (#9736) 2023-07-21 08:20:33 -05:00
repl.rs Add functions for each Value case (#9736) 2023-07-21 08:20:33 -05:00
syntax_highlight.rs Avoid blocking when o+e> redirects too much stderr message (#8784) 2023-05-17 17:47:03 -05:00
util.rs Fix config creation during printing (#9353) 2023-06-04 22:04:28 +03:00
validation.rs Remove old alias implementation (#8797) 2023-04-07 21:09:38 +03:00