mirror of
https://github.com/containers/podman.git
synced 2025-06-21 01:19:15 +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)
|
imgs = append(imgs, h)
|
||||||
}
|
}
|
||||||
|
|
||||||
enc := json.NewEncoder(os.Stdout)
|
prettyJSON, err := json.MarshalIndent(imgs, "", " ")
|
||||||
return enc.Encode(imgs)
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
fmt.Println(string(prettyJSON))
|
||||||
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func writeTemplate(imageS []*entities.ImageSummary) error {
|
func writeTemplate(imageS []*entities.ImageSummary) error {
|
||||||
|
Reference in New Issue
Block a user