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
commit 33a6027613
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 2 deletions

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 {