package zsh

import (
	
	

	
	
)

type message struct {
	common.Meta
}

func ( message) () string {
	 := make([]string, 0)
	for ,  := range .Messages.Get() {
		 = append(, .formatMessage(, style.Carapace.Error))
	}
	if .Usage != "" {
		 = append(, .formatMessage(.Usage, style.Carapace.Usage))
	}

	if len() > 0 {
		return strings.Join(, "\n")
	}
	return ""
}

func ( message) (,  string) string {
	 := strings.NewReplacer(
		"\n", ``,
		"\r", ``,
		"\t", ``,
		"\v", ``,
		"\f", ``,
		"\b", ``,
	).Replace()

	return fmt.Sprintf("\x1b[%vm%v\x1b[%vm", style.SGR(), , style.SGR("fg-default"))
}