sm
/
jsoon
1
0
Bifurcation 0
Cette révision appartient à :
Stephen McQuay 2015-04-12 22:38:13 -07:00
révision 01c5c905eb
3 fichiers modifiés avec 46 ajouts et 0 suppressions

14
LICENSE Fichier normal
Voir le fichier

@ -0,0 +1,14 @@
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2004 Sam Hocevar <sam@hocevar.net>
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.

10
README.md Fichier normal
Voir le fichier

@ -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.

22
main.go Fichier normal
Voir le fichier

@ -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)
}