mirror of https://github.com/golang-jwt/jwt.git
Merge pull request #17 from cryptix/prettierPretty
change pretty to compact
This commit is contained in:
commit
cdec324455
|
@ -20,10 +20,10 @@ import (
|
||||||
|
|
||||||
var (
|
var (
|
||||||
// Options
|
// Options
|
||||||
flagAlg = flag.String("alg", "", "signing algorithm identifier")
|
flagAlg = flag.String("alg", "", "signing algorithm identifier")
|
||||||
flagKey = flag.String("key", "", "path to key file or '-' to read from stdin")
|
flagKey = flag.String("key", "", "path to key file or '-' to read from stdin")
|
||||||
flagPretty = flag.Bool("pretty", true, "output pretty JSON")
|
flagCompact = flag.Bool("compact", false, "output compact JSON")
|
||||||
flagDebug = flag.Bool("debug", false, "print out all kinds of debug data")
|
flagDebug = flag.Bool("debug", false, "print out all kinds of debug data")
|
||||||
|
|
||||||
// Modes - exactly one of these is required
|
// Modes - exactly one of these is required
|
||||||
flagSign = flag.String("sign", "", "path to claims object to sign or '-' to read from stdin")
|
flagSign = flag.String("sign", "", "path to claims object to sign or '-' to read from stdin")
|
||||||
|
@ -86,7 +86,7 @@ func printJSON(j interface{}) error {
|
||||||
var out []byte
|
var out []byte
|
||||||
var err error
|
var err error
|
||||||
|
|
||||||
if *flagPretty {
|
if *flagCompact == false {
|
||||||
out, err = json.MarshalIndent(j, "", " ")
|
out, err = json.MarshalIndent(j, "", " ")
|
||||||
} else {
|
} else {
|
||||||
out, err = json.Marshal(j)
|
out, err = json.Marshal(j)
|
||||||
|
|
Loading…
Reference in New Issue