Prompt related functionality
(command string, rest string)
| 599 | |
| 600 | // Prompt related functionality |
| 601 | func (u *UserRecord) StartPrompt(command string, rest string) (*prompt.Prompt, bool) { |
| 602 | |
| 603 | if u.activePrompt != nil { |
| 604 | // If it's the same prompt, return the existing one |
| 605 | if u.activePrompt.Command == command && u.activePrompt.Rest == rest { |
| 606 | return u.activePrompt, false |
| 607 | } |
| 608 | } |
| 609 | |
| 610 | // If no prompt found or it seems like a new prompt, create a new one and replace the old |
| 611 | u.activePrompt = prompt.New(command, rest) |
| 612 | |
| 613 | return u.activePrompt, true |
| 614 | } |
| 615 | |
| 616 | func (u *UserRecord) GetPrompt() *prompt.Prompt { |
| 617 |
no test coverage detected