diff --git a/internal/clis/hmsecrets/get-arr.go b/internal/clis/hmsecrets/get-arr.go index 050113c..797025d 100644 --- a/internal/clis/hmsecrets/get-arr.go +++ b/internal/clis/hmsecrets/get-arr.go @@ -1,6 +1,7 @@ package hmsecrets import ( + "encoding/json" "fmt" "github.com/spf13/cobra" @@ -20,7 +21,11 @@ var getArrCmd = &cobra.Command{ if err != nil { return err } - fmt.Println(secret) + secretJSON, err := json.MarshalIndent(secret, "", " ") + if err != nil { + return err + } + fmt.Println(string(secretJSON)) return nil }, } diff --git a/internal/clis/hmsecrets/get-map.go b/internal/clis/hmsecrets/get-map.go index 29103d4..505fbc0 100644 --- a/internal/clis/hmsecrets/get-map.go +++ b/internal/clis/hmsecrets/get-map.go @@ -1,6 +1,7 @@ package hmsecrets import ( + "encoding/json" "fmt" "github.com/spf13/cobra" @@ -20,7 +21,11 @@ var getMapCmd = &cobra.Command{ if err != nil { return err } - fmt.Println(secret) + secretJSON, err := json.MarshalIndent(secret, "", " ") + if err != nil { + return err + } + fmt.Println(string(secretJSON)) return nil }, }