change size label depending on size type

This commit is contained in:
Nate Jones 2016-05-05 10:58:14 -07:00
parent 7ea47fc9cf
commit 1e678b70e3

View file

@ -353,13 +353,16 @@ func PrintTreeNode(buffer *bytes.Buffer, image Image, noTrunc bool, incremental
} }
var size int64 var size int64
var sizeLabel string
if incremental { if incremental {
sizeLabel = "Size"
size = image.Size size = image.Size
} else { } else {
sizeLabel = "Virtual Size"
size = image.VirtualSize size = image.VirtualSize
} }
buffer.WriteString(fmt.Sprintf("%s%s Virtual Size: %s", prefix, imageID, humanSize(size))) buffer.WriteString(fmt.Sprintf("%s%s %s: %s", prefix, imageID, sizeLabel, humanSize(size)))
if image.RepoTags[0] != "<none>:<none>" { if image.RepoTags[0] != "<none>:<none>" {
buffer.WriteString(fmt.Sprintf(" Tags: %s\n", strings.Join(image.RepoTags, ", "))) buffer.WriteString(fmt.Sprintf(" Tags: %s\n", strings.Join(image.RepoTags, ", ")))
} else { } else {