Skip to content

Commit ed281dd

Browse files
committed
image/list: Print legend only if limiting width
Signed-off-by: Paweł Gronowski <[email protected]>
1 parent aa5d00a commit ed281dd

File tree

5 files changed

+5
-5
lines changed

5 files changed

+5
-5
lines changed
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
Info -> U In Use
21
IMAGE ID DISK USAGE CONTENT SIZE EXTRA
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
Info -> U In Use
21
IMAGE ID DISK USAGE CONTENT SIZE EXTRA
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
Info -> U In Use
21
IMAGE ID DISK USAGE CONTENT SIZE EXTRA
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
Info -> U In Use
21
IMAGE ID DISK USAGE CONTENT SIZE EXTRA

cli/command/image/tree.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,7 @@ func printImageTree(outs command.Streams, view treeView) {
233233
isTerm := out.IsTerminal()
234234

235235
_, width := out.GetTtySize()
236+
limitWidth := width == 0
236237
if isTerm && width < 20 {
237238
width = 20
238239
}
@@ -242,7 +243,10 @@ func printImageTree(outs command.Streams, view treeView) {
242243
untaggedColor := out.Color(tui.ColorTertiary)
243244
titleColor := out.Color(tui.ColorTitle)
244245

245-
out.Println(generateLegend(out, width))
246+
// Legend is right-aligned, so don't print it if the width is unlimited
247+
if !limitWidth {
248+
out.Println(generateLegend(out, width))
249+
}
246250

247251
possibleChips := getPossibleChips(view)
248252
columns := []imgColumn{

0 commit comments

Comments
 (0)