package line

import (
	
	

	
)

var (
    // Base text effects.
	Reset      = "\x1b[0m"
	Bold       = "\x1b[1m"
	Dim        = "\x1b[2m"
	Underscore = "\x1b[4m"
	Blink      = "\x1b[5m"
	Reverse    = "\x1b[7m"

	// Effects reset.
	BoldReset       = "\x1b[22m" // 21 actually causes underline instead
	DimReset        = "\x1b[22m"
	UnderscoreReset = "\x1b[24m"
	BlinkReset      = "\x1b[25m"
	ReverseReset    = "\x1b[27m"

    // Colors
	GreenFG  = "\x1b[32m"
	YellowFG = "\x1b[33m"
	ResetFG  = "\x1b[39m"
	BrightWhiteFG = "\x1b[38;05;244m"
)

// HighlightCommand applies highlighting to commands in an input line.
func (,  []string,  *cobra.Command,  string) ([]string, []string) {
	 := make([]string, 0)
	var  []string

	if len() == 0 {
		return , 
	}

	// Highlight the root command when found, or any of its aliases.
	for ,  := range .Commands() {
		// Change 1: Highlight based on first arg in usage rather than the entire usage itself
		 := strings.Split(.Use, " ")[0] == strings.TrimSpace([0])

        if slices.Contains(.Aliases, strings.TrimSpace([0])) {
				 = true
				break
		}

		if  {
			 = append(, Bold++[0]+ResetFG+BoldReset)
			 = [1:]

			return append(, ...), 
		}
	}

	return append(, ...), 
}

// HighlightCommand applies highlighting to command flags in an input line.
func (,  []string,  string) ([]string, []string) {
	 := make([]string, 0)
	var  []string

	if len() == 0 {
		return , 
	}

	for ,  := range  {
		if strings.HasPrefix(, "-") || strings.HasPrefix(, "--") {
			 = append(, Bold+++ResetFG+BoldReset)
		} else {
			 = append(, )
		}
	}

	return append(, ...), 
}