commit 01c5c905ebfd91f2f38466b49e009923dd92b6ad Author: stephen mcquay Date: Sun Apr 12 22:38:13 2015 -0700 init diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..ee7d6a5 --- /dev/null +++ b/LICENSE @@ -0,0 +1,14 @@ + DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE + Version 2, December 2004 + + Copyright (C) 2004 Sam Hocevar + + Everyone is permitted to copy and distribute verbatim or modified + copies of this license document, and changing it is allowed as long + as the name is changed. + + DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. You just DO WHAT THE FUCK YOU WANT TO. + diff --git a/README.md b/README.md new file mode 100644 index 0000000..4200e07 --- /dev/null +++ b/README.md @@ -0,0 +1,10 @@ +jsoon +===== + +Simple util for to be `python -mjson.tool` replacement. The second in my series +of small go programs to implement/replace cool tools I use frequently. + +"jsoon" because it takes a json stream and expands it. Seriously, look at the +code; you'd have to really try hard to make a simpler program. + +There are officially more letters in this readme at this point, actually. diff --git a/main.go b/main.go new file mode 100644 index 0000000..69f25c3 --- /dev/null +++ b/main.go @@ -0,0 +1,22 @@ +package main + +import ( + "bytes" + "encoding/json" + "io/ioutil" + "log" + "os" +) + +func main() { + b, err := ioutil.ReadAll(os.Stdin) + if err != nil { + log.Fatal("problem reading stdin", err) + } + var out bytes.Buffer + err = json.Indent(&out, b, "", "\t") + if err != nil { + log.Fatal(err) + } + out.WriteTo(os.Stdout) +}