You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -72,7 +79,8 @@ There are times that json data may contain templates, i.e., strings like `{{"{{V
72
79
}
73
80
```
74
81
75
-
What's worse is that when such template variables are for `int`, e.g.: `"age":{{"{{Var_Age}}"}}`, they then wouldn't be able to handle it.
82
+
What's worse is that when such template variables are for `int`, e.g.: `"age":{{"{{Var_Age}}"}}`, they then wouldn't be able to handle it, for inputs like
83
+
{{cat "test/CustomerP.json" | color "sh"}}
76
84
77
85
To make such template variables work for those tools, the `-p,--protect` option is introduced:
78
86
@@ -84,27 +92,33 @@ To make such template variables work for those tools, the `-p,--protect` option
84
92
85
93
$ jsonfiddle fmt -c -i test/Customer.json
86
94
87
-
#### > {{cat "test/Customer.ref" | color "json"}}
95
+
#### > {{cat "test/CustomerC.ref" | color "json"}}
88
96
89
97
You can also do,
90
98
91
-
$ cat Customer.json | jsonfiddle fmt -c -i
99
+
$ cat Customer.json | jsonfiddle fmt -c -i -
92
100
93
101
and the result is the same (and for all other examples using `-i` as well).
94
102
95
103
## Sort fields with `jsonfiddle sort`
96
104
105
+
### Sort in compact
106
+
107
+
$ jsonfiddle sort -c -i test/Customer.json
108
+
109
+
#### > {{cat "test/CustomerSC.ref" | color "json"}}
110
+
97
111
### Sort with pretty print
98
112
99
113
$ jsonfiddle sort -i test/Customer.json
100
114
101
115
#### > {{cat "test/CustomerSI.ref" | color "json"}}
102
116
103
-
### Sort in compact
104
-
105
-
$ jsonfiddle sort -c -i test/Customer.json
117
+
### XML to JSON, sort then pretty print
106
118
107
-
#### > {{cat "test/CustomerSC.ref" | color "json"}}
@@ -127,7 +141,7 @@ Thus all the JSON comparison tools I found are failing under such hash request.
127
141
- The latest binary executables are available under
128
142
https://github.com/go-jsonfile/{{.Name}}/releases
129
143
as the result of the Continuous-Integration process.
130
-
- I.e., they are built right from the source code during every git tagging commit automatically by [travis-ci](https://travis-ci.org/).
144
+
- I.e., they are built right from the source code during every git tagging commit automatically.
131
145
- Pick & choose the binary executable that suits your OS and its architecture. E.g., for Linux, it would most probably be the `{{.Name}}_linux_VER_amd64` file. If your OS and its architecture is not available in the download list, please let me know and I'll add it.
132
146
- You may want to rename it to a shorter name instead, e.g., `{{.Name}}`, after downloading it.
133
147
@@ -154,6 +168,8 @@ go get github.com/go-jsonfile/jsonfiddle
154
168
155
169
All the following similar projects have been considered before writing one on my own instead.
0 commit comments