Skip to content
Snippets Groups Projects
Unverified Commit 01ed1e7f authored by dlorenc's avatar dlorenc Committed by GitHub
Browse files

Merge pull request #245 from ahmetb/pretty-print

rekor-cli: Pretty print for get cmd
parents 41a12991 0718960b
No related branches found
No related tags found
No related merge requests found
......@@ -18,6 +18,7 @@ package app
import (
"bytes"
"encoding/base64"
"encoding/json"
"errors"
"fmt"
"strconv"
......@@ -46,7 +47,11 @@ func (g *getCmdOutput) String() string {
dt := time.Unix(g.IntegratedTime, 0).UTC().Format(time.RFC3339)
s += fmt.Sprintf("IntegratedTime: %s\n", dt)
s += fmt.Sprintf("UUID: %s\n", g.UUID)
s += fmt.Sprintf("Body: %s\n", g.Body)
var b bytes.Buffer
e := json.NewEncoder(&b)
e.SetIndent("", " ")
_ = e.Encode(g.Body)
s += fmt.Sprintf("Body: %s\n", b.Bytes())
return s
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment