MCPcopy
hub / github.com/keploy/keploy / printKeployLogo

Function printKeployLogo

cli/provider/util.go:46–64  ·  view source on GitHub ↗
(wr io.Writer, disableANSI bool, logo string)

Source from the content-addressed store, hash-verified

44}
45
46func printKeployLogo(wr io.Writer, disableANSI bool, logo string) {
47 const reset = "\033[0m"
48 lines := strings.Split(logo, "\n")
49
50 if !disableANSI {
51 for i, line := range lines {
52 for j, ch := range line {
53 color := getLogoColor(i, j)
54 // wrapper now uses fmt.Fprint, so this will correctly print color + char + reset
55 FprintWrapper(false, wr, color, string(ch), reset)
56 }
57 FprintWrapper(true, wr) // newline after each line
58 }
59 } else {
60 // plain logo (no per-char coloring)
61 FprintWrapper(false, wr, logo)
62 FprintWrapper(true, wr)
63 }
64}
65
66// FprintWrapper prints all its args (like fmt.Fprint) and optionally a leading newline.
67func FprintWrapper(newLine bool, wr io.Writer, a ...interface{}) {

Callers 1

PrintLogoFunction · 0.85

Calls 2

getLogoColorFunction · 0.85
FprintWrapperFunction · 0.85

Tested by

no test coverage detected