Skip to content

Commit b792669

Browse files
committed
- [*] update README
1 parent 81ea142 commit b792669

File tree

4 files changed

+76
-25
lines changed

4 files changed

+76
-25
lines changed

.goreleaser.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ builds:
2020
archive:
2121
name_template: '{{ .Binary }}_{{ .Os }}_{{ .Version }}_{{ .Arch }}'
2222
replacements:
23-
darwin: Darwin
23+
# darwin: Darwin
2424
windows: Windows
2525
# linux: Linux
2626
# amd64: x86_64

README.e.md

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ The `jsonfiddle` makes it easy to look at the JSON data from different aspects.
3434

3535
$ jsonfiddle fmt -i test/Customer.json
3636

37-
#### > {{cat "test/CustomerI.ref" | color "json"}}
37+
#### > {{cat "test/CustomerSI.ref" | color "json"}}
3838

3939
### Compact
4040

@@ -78,15 +78,28 @@ Thus all the JSON comparison tools I found are failing under such hash request.
7878
- Sorting the JSON data fields recursively and producing plain text file (via `jsonfiddle sort`), then use the state-of-the-art text comparison tools to compare them is the best approach, for my above scenario.
7979
- For extremely long and very complicated JSONs, converting json to abstract Go struct (via `jsonfiddle j2s`) is the quickest approach to compare them at higher level.
8080

81+
# Download binaries
82+
83+
- The latest binary executables are available under
84+
https://github.com/go-jsonfile/{{.Name}}/releases
85+
as the result of the Continuous-Integration process.
86+
- I.e., they are built right from the source code during every git tagging commit automatically by [travis-ci](https://travis-ci.org/).
87+
- 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.
88+
- You may want to rename it to a shorter name instead, e.g., `{{.Name}}`, after downloading it.
89+
90+
91+
# Debian package
8192

82-
# Installation
93+
Available at the above releases url as well.
94+
95+
# Install Source
96+
97+
To install the source code instead:
8398

8499
```
85100
go get github.com/go-jsonfile/jsonfiddle
86101
```
87102

88-
All patches welcome.
89-
90103

91104
## Credits
92105

README.md

Lines changed: 52 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,20 @@
1616
- [Examples](#examples)
1717
- [Format with `jsonfiddle fmt`](#format-with-`jsonfiddle-fmt`)
1818
- [Pretty print](#pretty-print)
19-
- [> test/CustomerI.ref](#-testcustomeriref)
19+
- [> test/CustomerSI.ref](#-testcustomersiref)
2020
- [Compact](#compact)
2121
- [> test/Customer.ref](#-testcustomerref)
2222
- [Sort fields with `jsonfiddle sort`](#sort-fields-with-`jsonfiddle-sort`)
2323
- [Sort with pretty print](#sort-with-pretty-print)
24-
- [> test/CustomerSI.ref](#-testcustomersiref)
24+
- [> test/CustomerSI.ref](#-testcustomersiref-1)
2525
- [Sort in compact](#sort-in-compact)
2626
- [> test/CustomerSC.ref](#-testcustomerscref)
2727
- [JSON to struct via `jsonfiddle j2s`](#json-to-struct-via-`jsonfiddle-j2s`)
2828
- [> test/CustomerJ2S.ref](#-testcustomerj2sref)
2929
- [Purpose](#purpose)
30-
- [Installation](#installation)
30+
- [Download binaries](#download-binaries)
31+
- [Debian package](#debian-package)
32+
- [Install Source](#install-source)
3133
- [Credits](#credits)
3234
- [Similar Projects](#similar-projects)
3335
- [Author(s) & Contributor(s)](#author(s)-&-contributor(s))
@@ -45,7 +47,7 @@ The `jsonfiddle` makes it easy to look at the JSON data from different aspects.
4547
### $ jsonfiddle
4648
```sh
4749
JSON Fiddling
48-
built on 2017-07-16
50+
Version v0.2.0 built on 2017-08-12
4951

5052
Tool to fiddle with json strings
5153

@@ -121,7 +123,36 @@ Options:
121123

122124
$ jsonfiddle fmt -i test/Customer.json
123125

124-
#### > test/CustomerI.ref
126+
#### > test/CustomerSI.ref
127+
```json
128+
{
129+
"address": {
130+
"city": "New York",
131+
"postalCode": "10021",
132+
"state": "NY",
133+
"streetAddress": "21 2nd Street"
134+
},
135+
"age": 25,
136+
"firstName": "John",
137+
"lastName": "Smith",
138+
"phoneNumber": [
139+
{
140+
"number": "212 555-1234",
141+
"type": "home"
142+
},
143+
{
144+
"number": "646 555-4567",
145+
"type": "fax"
146+
}
147+
]
148+
}
149+
```
150+
151+
### Compact
152+
153+
$ jsonfiddle fmt -c -i test/Customer.json
154+
155+
#### > test/Customer.ref
125156
```json
126157
{
127158
"firstName": "John",
@@ -146,15 +177,6 @@ Options:
146177
}
147178
```
148179

149-
### Compact
150-
151-
$ jsonfiddle fmt -c -i test/Customer.json
152-
153-
#### > test/Customer.ref
154-
```json
155-
{"firstName":"John","lastName":"Smith","age":25,"address":{"streetAddress":"21 2nd Street","city":"New York","state":"NY","postalCode":"10021"},"phoneNumber":[{"type":"home","number":"212 555-1234"},{"type":"fax","number":"646 555-4567"}]}
156-
```
157-
158180
You can also do,
159181

160182
$ cat Customer.json | jsonfiddle fmt -c -i
@@ -236,15 +258,28 @@ Thus all the JSON comparison tools I found are failing under such hash request.
236258
- Sorting the JSON data fields recursively and producing plain text file (via `jsonfiddle sort`), then use the state-of-the-art text comparison tools to compare them is the best approach, for my above scenario.
237259
- For extremely long and very complicated JSONs, converting json to abstract Go struct (via `jsonfiddle j2s`) is the quickest approach to compare them at higher level.
238260

261+
# Download binaries
262+
263+
- The latest binary executables are available under
264+
https://github.com/go-jsonfile/jsonfiddle/releases
265+
as the result of the Continuous-Integration process.
266+
- I.e., they are built right from the source code during every git tagging commit automatically by [travis-ci](https://travis-ci.org/).
267+
- Pick & choose the binary executable that suits your OS and its architecture. E.g., for Linux, it would most probably be the `jsonfiddle_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.
268+
- You may want to rename it to a shorter name instead, e.g., `jsonfiddle`, after downloading it.
239269

240-
# Installation
270+
271+
# Debian package
272+
273+
Available at the above releases url as well.
274+
275+
# Install Source
276+
277+
To install the source code instead:
241278

242279
```
243280
go get github.com/go-jsonfile/jsonfiddle
244281
```
245282

246-
All patches welcome.
247-
248283

249284
## Credits
250285

jsonfiddleCLIDef.go

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ type rootT struct {
2727

2828
var root = &cli.Command{
2929
Name: "jsonfiddle",
30-
Desc: "JSON Fiddling\nbuilt on " + date,
30+
Desc: "JSON Fiddling\nVersion " + version + " built on " + date,
3131
Text: "Tool to fiddle with json strings",
3232
Global: true,
3333
Argv: func() interface{} { return new(rootT) },
@@ -42,8 +42,8 @@ var root = &cli.Command{
4242

4343
// var (
4444
// progname = "jsonfiddle"
45-
// VERSION = "0.1.0"
46-
// date = "2017-07-16"
45+
// version = "0.1.0"
46+
// date = "2017-08-12"
4747
// )
4848

4949
// var rootArgv *rootT
@@ -97,6 +97,7 @@ type fmtT struct {
9797
var fmtDef = &cli.Command{
9898
Name: "fmt",
9999
Desc: "Format json string",
100+
100101
Argv: func() interface{} { return new(fmtT) },
101102
Fn: fmtCLI,
102103

@@ -121,6 +122,7 @@ type sortT struct {
121122
var sortDef = &cli.Command{
122123
Name: "sort",
123124
Desc: "Sort json fields recursively",
125+
124126
Argv: func() interface{} { return new(sortT) },
125127
Fn: sortCLI,
126128

@@ -149,6 +151,7 @@ type j2sT struct {
149151
var j2sDef = &cli.Command{
150152
Name: "j2s",
151153
Desc: "JSON to struct",
154+
152155
Argv: func() interface{} { return new(j2sT) },
153156
Fn: j2sCLI,
154157

0 commit comments

Comments
 (0)