Fix the JSON beautifier flag

This commit is contained in:
Dan Sosedoff
2017-09-16 21:57:04 -05:00
parent 3c515fcef3
commit 26ea9fc1b8
2 changed files with 25 additions and 24 deletions

View File

@@ -112,11 +112,12 @@ func (res *Result) CSV() []byte {
func (res *Result) JSON() []byte {
var data []byte
if command.Opts.EnablePrettyJson {
data, _ = json.MarshalIndent(res.Format(), "", " ")
} else {
if command.Opts.DisablePrettyJson {
data, _ = json.Marshal(res.Format())
} else {
data, _ = json.MarshalIndent(res.Format(), "", " ")
}
return data
}