Add newline printing to --select-if-one (#459)

* Add newline printing to --select-if-one

This matches how choose works normally when there are more than
one option.

* Add newline printing to filter --select-if-one

To match how it works without --select-if-one.
This commit is contained in:
snan 2023-12-07 16:29:40 +01:00 committed by GitHub
parent c9afacc74b
commit d1145b4163
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 0 deletions

View file

@ -35,6 +35,7 @@ func (o Options) Run() error {
if o.SelectIfOne && len(o.Options) == 1 {
print(o.Options[0])
print("\n")
return nil
}

View file

@ -49,6 +49,7 @@ func (o Options) Run() error {
} else {
fmt.Print(ansi.Strip(o.Options[0]))
}
print("\n")
return nil
}