MCPcopy Create free account
hub / github.com/astercloud/aster / printColored

Function printColored

cmd/aster/session.go:481–487  ·  view source on GitHub ↗

printColored prints colored output if colors are enabled

(useColor bool, color, format string, args ...any)

Source from the content-addressed store, hash-verified

479
480// printColored prints colored output if colors are enabled
481func printColored(useColor bool, color, format string, args ...any) {
482 if useColor {
483 fmt.Printf(color+format+colorReset, args...)
484 } else {
485 fmt.Printf(format, args...)
486 }
487}
488
489// isTerminal checks if the writer is a terminal
490func isTerminal(w io.Writer) bool {

Callers 6

runSessionFunction · 0.85
handleAgentEventsFunction · 0.85
runREPLFunction · 0.85
handleCommandFunction · 0.85
printWelcomeFunction · 0.85
printHelpFunction · 0.85

Calls 1

PrintfMethod · 0.80

Tested by

no test coverage detected