MCPcopy Index your code
hub / github.com/docker/cli / PrintR

Method PrintR

cli/command/image/tree.go:529–542  ·  view source on GitHub ↗
(clr aec.ANSI, s string)

Source from the content-addressed store, hash-verified

527}
528
529func (h imgColumn) PrintR(clr aec.ANSI, s string) string {
530 ln := tui.Width(s)
531 fill := h.Width - ln
532
533 if fill < 0 {
534 if h.NoEllipsis {
535 fill = 0
536 } else {
537 return clr.Apply(tui.Ellipsis(s, h.Width))
538 }
539 }
540
541 return strings.Repeat(" ", fill) + clr.Apply(s)
542}
543
544// widestFirstColumnValue calculates the width needed to fully display the image names and platforms.
545func widestFirstColumnValue(headers []imgColumn, images []topImage) int {

Callers 1

PrintMethod · 0.95

Calls 1

ApplyMethod · 0.80

Tested by

no test coverage detected