diff --git a/crates/nu-command/src/platform/ansi/ansi_.rs b/crates/nu-command/src/platform/ansi/ansi_.rs index 43cf1fe40b..fda9dc0f51 100644 --- a/crates/nu-command/src/platform/ansi/ansi_.rs +++ b/crates/nu-command/src/platform/ansi/ansi_.rs @@ -507,7 +507,10 @@ impl Command for AnsiCommand { fn signature(&self) -> Signature { Signature::build("ansi") - .input_output_types(vec![(Type::Nothing, Type::String)]) + .input_output_types(vec![ + (Type::Nothing, Type::String), + (Type::List(Box::new(Type::String)), Type::String), + ]) .optional( "code", SyntaxShape::Any, @@ -599,13 +602,9 @@ Format: # Example { description: "Use ansi to color text (italic bright yellow on red 'Hello' with green bold 'Nu' and purple bold 'World')", example: r#"[(ansi -e '3;93;41m') Hello (ansi reset) " " (ansi gb) Nu " " (ansi pb) World (ansi reset)] | str join"#, - result: None, - // Test disabled because the final expression in the pipeline is - // not the command being tested, and this violated assumptions - // made by the run-time input/output type-checking tests. - // result: Some(Value::test_string( - // "\u{1b}[3;93;41mHello\u{1b}[0m \u{1b}[1;32mNu \u{1b}[1;35mWorld\u{1b}[0m", - // )), + result: Some(Value::test_string( + "\u{1b}[3;93;41mHello\u{1b}[0m \u{1b}[1;32mNu \u{1b}[1;35mWorld\u{1b}[0m", + )), }, Example { description: "Use ansi to color text with a style (blue on red in bold)",