splitProfileKV splits "key=value" or "key: value" into its parts.
(s string)
| 337 | |
| 338 | // splitProfileKV splits "key=value" or "key: value" into its parts. |
| 339 | func splitProfileKV(s string) (key, value string, ok bool) { |
| 340 | for _, sep := range []string{"=", ":"} { |
| 341 | if idx := strings.Index(s, sep); idx > 0 { |
| 342 | key = strings.TrimSpace(s[:idx]) |
| 343 | value = strings.TrimSpace(s[idx+len(sep):]) |
| 344 | if key != "" && value != "" { |
| 345 | return key, value, true |
| 346 | } |
| 347 | } |
| 348 | } |
| 349 | return "", "", false |
| 350 | } |
| 351 | |
| 352 | func (cli *ChatCLI) showMemoryTopics() { |
| 353 | mgr := cli.memoryStore.Manager() |
no outgoing calls