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

Function generateLegend

cli/command/image/tree.go:382–397  ·  view source on GitHub ↗
(out tui.Output, width uint)

Source from the content-addressed store, hash-verified

380}
381
382func generateLegend(out tui.Output, width uint) string {
383 var legend string
384 legend += out.Sprint(tui.InfoHeader)
385 var legendSb371 strings.Builder
386 for idx, chip := range allChips {
387 legendSb371.WriteString(" " + out.Sprint(chip) + " " + chip.desc)
388 if idx < len(allChips)-1 {
389 legendSb371.WriteString(" |")
390 }
391 }
392 legend += legendSb371.String()
393
394 r := max(int(width)-tui.Width(legend), 0)
395 legend = strings.Repeat(" ", r) + legend
396 return legend
397}
398
399func printDetails(out tui.Output, headers []imgColumn, defaultColor aec.ANSI, details imageDetails) {
400 for _, h := range headers {

Callers 1

printImageTreeFunction · 0.85

Calls 2

SprintMethod · 0.80
StringMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…