From b9278bdfe15321466173dc78627f3210f9b81e5c Mon Sep 17 00:00:00 2001 From: Darren Schroeder <343840+fdncred@users.noreply.github.com> Date: Mon, 20 Jul 2020 14:25:38 -0500 Subject: [PATCH] Char example (#2231) * added ansi example * added another example * changed example * ansi changes here by mistake --- crates/nu-cli/src/commands/char_.rs | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/crates/nu-cli/src/commands/char_.rs b/crates/nu-cli/src/commands/char_.rs index 91bc257cf8..99ca9421bc 100644 --- a/crates/nu-cli/src/commands/char_.rs +++ b/crates/nu-cli/src/commands/char_.rs @@ -30,11 +30,22 @@ impl WholeStreamCommand for Char { } fn examples(&self) -> Vec { - vec![Example { - description: "Output newline", - example: r#"char newline"#, - result: Some(vec![Value::from("\n")]), - }] + vec![ + Example { + description: "Output newline", + example: r#"char newline"#, + result: Some(vec![Value::from("\n")]), + }, + Example { + description: "Output prompt character, newline and a hamburger character", + example: r#"echo $(char prompt) $(char newline) $(char hamburger)"#, + result: Some(vec![ + UntaggedValue::string("\u{25b6}").into(), + UntaggedValue::string("\n").into(), + UntaggedValue::string("\u{2261}").into(), + ]), + }, + ] } async fn run(