From 92c7f4eb9e50d0b35aa048c5149cb95ce5c4e507 Mon Sep 17 00:00:00 2001 From: TomSweeneyRedHat Date: Wed, 12 Dec 2018 14:29:40 -0500 Subject: Show image only once with images -q Signed-off-by: TomSweeneyRedHat --- cmd/podman/images.go | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'cmd') diff --git a/cmd/podman/images.go b/cmd/podman/images.go index 3351123ed..a1aeb6042 100644 --- a/cmd/podman/images.go +++ b/cmd/podman/images.go @@ -280,7 +280,9 @@ func getImagesTemplateOutput(ctx context.Context, runtime *libpod.Runtime, image if !opts.noTrunc { imageID = shortID(img.ID()) } + // get all specified repo:tag pairs and print them separately + outer: for repo, tags := range image.ReposToMap(img.Names()) { for _, tag := range tags { size, err := img.Size(ctx) @@ -302,6 +304,10 @@ func getImagesTemplateOutput(ctx context.Context, runtime *libpod.Runtime, image Size: sizeStr, } imagesOutput = append(imagesOutput, params) + if opts.quiet { // Show only one image ID when quiet + break outer + } + } } } -- cgit v1.2.3-54-g00ecf