(userInput, command string)
| 49 | } |
| 50 | |
| 51 | func 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 |
| 61 | func (cli *ChatCLI) processHistoryCommand(userInput string) (string, string) { |
no outgoing calls
no test coverage detected