MCPcopy Create free account
hub / github.com/diillson/chatcli / removeCommandAndNormalizeSpaces

Function removeCommandAndNormalizeSpaces

cli/cli_commands.go:51–58  ·  view source on GitHub ↗
(userInput, command string)

Source from the content-addressed store, hash-verified

49}
50
51func removeCommandAndNormalizeSpaces(userInput, command string) string {
52 regexPattern := fmt.Sprintf(`(?i)\s*%s\s*`, regexp.QuoteMeta(command))
53 re := regexp.MustCompile(regexPattern)
54 userInput = re.ReplaceAllString(userInput, " ")
55 userInput = regexp.MustCompile(`\s+`).ReplaceAllString(userInput, " ")
56 userInput = strings.TrimSpace(userInput)
57 return userInput
58}
59
60// processHistoryCommand adiciona o histórico do shell ao contexto
61func (cli *ChatCLI) processHistoryCommand(userInput string) (string, string) {

Callers 3

processHistoryCommandMethod · 0.85
processGitCommandMethod · 0.85
processEnvCommandMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected