mirror of
https://github.com/nushell/nushell
synced 2024-12-29 14:33:13 +00:00
Char example (#2231)
* added ansi example * added another example * changed example * ansi changes here by mistake
This commit is contained in:
parent
6eb2c94209
commit
b9278bdfe1
1 changed files with 16 additions and 5 deletions
|
@ -30,11 +30,22 @@ impl WholeStreamCommand for Char {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn examples(&self) -> Vec<Example> {
|
fn examples(&self) -> Vec<Example> {
|
||||||
vec![Example {
|
vec![
|
||||||
description: "Output newline",
|
Example {
|
||||||
example: r#"char newline"#,
|
description: "Output newline",
|
||||||
result: Some(vec![Value::from("\n")]),
|
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(
|
async fn run(
|
||||||
|
|
Loading…
Reference in a new issue