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

Method PrintC

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

Source from the content-addressed store, hash-verified

492}
493
494func (h imgColumn) PrintC(clr aec.ANSI, s string) string {
495 ln := tui.Width(s)
496
497 fill := h.Width - ln
498
499 if fill < 0 {
500 if h.NoEllipsis {
501 fill = 0
502 } else {
503 return clr.Apply(tui.Ellipsis(s, h.Width))
504 }
505 }
506
507 l := fill / 2
508 r := fill - l
509
510 return strings.Repeat(" ", l) + clr.Apply(s) + strings.Repeat(" ", r)
511}
512
513func (h imgColumn) PrintL(clr aec.ANSI, s string) string {
514 ln := tui.Width(s)

Callers 1

PrintMethod · 0.95

Calls 1

ApplyMethod · 0.80

Tested by

no test coverage detected