fix(choose): --no-limit when 1 option available should still allow selection

This commit is contained in:
Maas Lalani 2023-07-25 12:38:55 -04:00
parent 6763de12e8
commit a61f3bdc3f
No known key found for this signature in database
GPG key ID: 5A6ED5CBF1A0A000

View file

@ -46,7 +46,7 @@ func (o Options) Run() error {
// If we've set no limit then we can simply select as many options as there
// are so let's set the limit to the number of options.
if o.NoLimit {
o.Limit = len(o.Options)
o.Limit = len(o.Options) + 1
}
if len(o.Selected) > o.Limit {