INNER CODE UNIT · Go

runKubecolorCommand

kubecolor/kubecolor · internal/cmd/imagegen/main.go:232

func runKubecolorCommand(cmd Command, env *EnvStore) (string, error) {
	defer restoreEnv(os.Environ())
	os.Clearenv()

	var buf bytes.Buffer

	buf.WriteString(flags.promptColor.Render(flags.prompt))
	buf.WriteByte(' ')
	buf.WriteString(flags.cmdColor.Render(flags.cmd))
	for _, arg := range cmd.Args {
		buf.WriteByte(' ')
		if strings.HasPrefix(arg, "-") {
			buf.WriteString(flags.flagColor.Render(arg))
		} else {
			buf.WriteString(flags.argColor.Render(arg))
		}
	}
	buf.WriteByte('\n')

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…