mirror of
https://github.com/nushell/nushell.git
synced 2024-11-22 08:23:24 +01:00
str-expand: Add Escaping Example (#9841)
**Related Issue: #9838** Adds an **example**, how bracoxide/str-expand handles the escaping char `\`.
This commit is contained in:
parent
87abfee268
commit
e16ce1df36
@ -48,6 +48,30 @@ impl Command for SubCommand {
|
||||
},)
|
||||
},
|
||||
|
||||
Example {
|
||||
description: "Ignore the next character after the backslash ('\\')",
|
||||
example: "'A{B\\,,C}' | str expand",
|
||||
result: Some(Value::List{
|
||||
vals: vec![
|
||||
Value::test_string("AB,"),
|
||||
Value::test_string("AC"),
|
||||
],
|
||||
span: Span::test_data()
|
||||
},)
|
||||
},
|
||||
|
||||
Example {
|
||||
description: "Use double backslashes to add a backslash.",
|
||||
example: "'A{B\\\\,C}' | str expand",
|
||||
result: Some(Value::List{
|
||||
vals: vec![
|
||||
Value::test_string("AB\\"),
|
||||
Value::test_string("AC"),
|
||||
],
|
||||
span: Span::test_data()
|
||||
},)
|
||||
},
|
||||
|
||||
Example {
|
||||
description: "Export comma separated values inside braces (`{}`) to a string list.",
|
||||
example: "\"{apple,banana,cherry}\" | str expand",
|
||||
|
Loading…
Reference in New Issue
Block a user