mirror of
https://github.com/nushell/nushell
synced 2024-12-26 04:53:09 +00: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
1 changed files with 24 additions and 0 deletions
|
@ -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 a new issue