MCPcopy
hub / github.com/cli/cli / PrintBulletPoints

Method PrintBulletPoints

pkg/cmd/attestation/io/handler.go:71–88  ·  view source on GitHub ↗
(rows [][]string)

Source from the content-addressed store, hash-verified

69}
70
71func (h *Handler) PrintBulletPoints(rows [][]string) (int, error) {
72 if !h.IO.IsStdoutTTY() {
73 return 0, nil
74 }
75 maxColLen := 0
76 for _, row := range rows {
77 if len(row[0]) > maxColLen {
78 maxColLen = len(row[0])
79 }
80 }
81
82 info := ""
83 for _, row := range rows {
84 dots := strings.Repeat(".", maxColLen-len(row[0]))
85 info += fmt.Sprintf("%s:%s %s\n", row[0], dots, row[1])
86 }
87 return fmt.Fprintln(h.IO.ErrOut, info)
88}

Callers 1

runVerifyFunction · 0.80

Calls 1

IsStdoutTTYMethod · 0.80

Tested by

no test coverage detected