Small cleanup on buildah rmi to make code cleaner

While adding rmi to ocid, I was asked to make this change, so want
to keep the code in buildah and ocid for these functions as close as
possible to the same.

Signed-off-by: Dan Walsh <dwalsh@redhat.com>

Closes: #69
Approved by: nalind
This commit is contained in:
Dan Walsh
2017-04-14 06:09:23 -04:00
committed by Atomic Bot
parent cbeb888e30
commit 8c8a13fdc2

View File

@@ -65,17 +65,17 @@ func imagesCmd(c *cli.Context) error {
for _, image := range images {
if quiet {
fmt.Printf("%s\n", image.ID)
} else {
names := []string{""}
if len(image.Names) > 0 {
names = image.Names
}
for _, name := range names {
if truncate {
fmt.Printf("%-12.12s %s\n", image.ID, name)
} else {
fmt.Printf("%-64s %s\n", image.ID, name)
}
continue
}
names := []string{""}
if len(image.Names) > 0 {
names = image.Names
}
for _, name := range names {
if truncate {
fmt.Printf("%-12.12s %s\n", image.ID, name)
} else {
fmt.Printf("%-64s %s\n", image.ID, name)
}
}
}