mirror of
https://github.com/containers/podman.git
synced 2025-06-20 09:03:43 +08:00
Merge pull request #6690 from vrothberg/fix-6687
podman images --format json: pretty print
This commit is contained in:
@ -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 {
|
||||
|
Reference in New Issue
Block a user