diff --git a/crates/nu-cli/src/print.rs b/crates/nu-cli/src/print.rs index 1a6d7d146f..f5eb6e4215 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 9813c37780..2c22ac708e 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()); +}