diff --git a/choose/command.go b/choose/command.go index 9a621a273..47e354907 100644 --- a/choose/command.go +++ b/choose/command.go @@ -26,8 +26,10 @@ func (o Options) Run() error { verySubduedStyle = lipgloss.NewStyle().Foreground(lipgloss.AdaptiveColor{Light: "#DDDADA", Dark: "#3C3C3C"}) ) - if len(o.Options) <= 0 { - input, _ := stdin.Read(stdin.StripANSI(o.StripANSI)) + input, _ := stdin.Read(stdin.StripANSI(o.StripANSI)) + if len(o.Options) > 0 && len(o.Selected) == 0 { + o.Selected = strings.Split(input, o.InputDelimiter) + } else if len(o.Options) == 0 { if input == "" { return errors.New("no options provided, see `gum choose --help`") }