Fix for using --value in combination w/ --no-fuzzy

This add a check if the no fuzzy flag is set together with the
--no-fuzzy flag.
This commit is contained in:
mikael 2023-03-07 22:59:37 +01:00 committed by Maas Lalani
parent 2bda001480
commit 708a653eae

View file

@ -53,8 +53,13 @@ func (o Options) Run() error {
var matches []fuzzy.Match
if o.Value != "" {
i.SetValue(o.Value)
}
switch {
case o.Value != "" && o.Fuzzy:
matches = fuzzy.Find(o.Value, choices)
} else {
case o.Value != "" && !o.Fuzzy:
matches = exactMatches(o.Value, choices)
default:
matches = matchAll(choices)
}