diff --git a/cmd/help/main.go b/cmd/help/main.go index ad81b82..0320586 100644 --- a/cmd/help/main.go +++ b/cmd/help/main.go @@ -72,15 +72,21 @@ func NewPrompter(tty *tty.TTY, cs colorScheme) *Prompter { } func (p *Prompter) String(prompt string) (string, error) { - fmt.Println("") - fmt.Println(p.cs.Prompt(prompt)) - fmt.Println(p.cs.Subtitle("(press enter to submit)")) - s, err := p.tty.ReadString() - if err != nil { - return "", fmt.Errorf("couldn't collect input: %w", err) + // TODO assumes blank is no bueno + + var err error + var answer string + for answer == "" { + fmt.Println("") + fmt.Println(p.cs.Prompt(prompt)) + fmt.Println(p.cs.Subtitle("(press enter to submit)")) + answer, err = p.tty.ReadString() + if err != nil { + return "", fmt.Errorf("couldn't collect input: %w", err) + } } - return s, nil + return answer, nil } func (p *Prompter) Select(prompt string, opts []string) (int, error) {