diff --git a/crates/nu-cli/src/print.rs b/crates/nu-cli/src/print.rs index 1a6d7d146..f5eb6e421 100644 --- a/crates/nu-cli/src/print.rs +++ b/crates/nu-cli/src/print.rs @@ -16,7 +16,11 @@ impl Command for Print { fn signature(&self) -> Signature { Signature::build("print") - .input_output_types(vec![(Type::Nothing, Type::Nothing)]) + .input_output_types(vec![ + (Type::Nothing, Type::Nothing), + (Type::Any, Type::Nothing), + ]) + .allow_variants_without_examples(true) .rest("rest", SyntaxShape::Any, "the values to print") .switch( "no-newline", diff --git a/tests/shell/pipeline/commands/internal.rs b/tests/shell/pipeline/commands/internal.rs index 9813c3778..2c22ac708 100644 --- a/tests/shell/pipeline/commands/internal.rs +++ b/tests/shell/pipeline/commands/internal.rs @@ -1111,3 +1111,10 @@ mod variable_scoping { ); } } + +#[test] +fn pipe_input_to_print() { + let actual = nu!(r#""foo" | print"#); + assert_eq!(actual.out, "foo"); + assert!(actual.err.is_empty()); +}