Merge pull request #6690 from vrothberg/fix-6687

podman images --format json: pretty print
This commit is contained in:
OpenShift Merge Robot
2020-06-19 10:44:54 -04:00
committed by GitHub

View File

@ -141,8 +141,12 @@ func writeJSON(imageS []*entities.ImageSummary) error {
imgs = append(imgs, h)
}
enc := json.NewEncoder(os.Stdout)
return enc.Encode(imgs)
prettyJSON, err := json.MarshalIndent(imgs, "", " ")
if err != nil {
return err
}
fmt.Println(string(prettyJSON))
return nil
}
func writeTemplate(imageS []*entities.ImageSummary) error {