Skip to content

Commit 6ade995

Browse files
committed
Escape backticks in bash formatter
1 parent 6fc70bf commit 6ade995

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

TODO.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,22 @@
11
# ToDo
22

3+
* Allow * in path filtering, e.g.:
4+
5+
Given the data:
6+
7+
[
8+
{
9+
"id": 1
10+
},
11+
{
12+
"id": 2
13+
}
14+
]
15+
16+
`please parse *.id` would result in:
17+
18+
[1, 2]
19+
320
* Tidy up help text - separate input/output params
421

522
Use [optional] and <value goes here> conventions

formatter/bash.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ func wrapObj(in interface{}) string {
1010
out := formatBash(in)
1111
out = strings.Replace(out, "\\", "\\\\", -1)
1212
out = strings.Replace(out, "\"", "\\\"", -1)
13+
out = strings.Replace(out, "`", "\\`", -1)
1314
out = strings.Replace(out, "\n", "\\n", -1)
1415
out = strings.Replace(out, "$", "\\$", -1)
1516
out = fmt.Sprintf("\"%s\"", out)

0 commit comments

Comments
 (0)