-
Notifications
You must be signed in to change notification settings - Fork 10
Open
Description
I'd like a way to express "Given this stdin and this --search argument, if after filtering there's only 1 remaining candidate, select it and write to stdout non-interactively, but if there's >1, go into interactive mode".
fzf has an argument -f, --filter=STR Filter mode. Do not start interactive finder., which I use to simulate this by filtering the input then checking the number of matches with wc and if there's 1 just proceeding to use the result, but piping to fzf if necessary to filter further. It's close, but what I really want is as described above.
For example, given this use case, I'd rather just get cat on stdout immediately and have hs exit 0.
printf 'cat\nrat\nbat' | hs -s cat
> cat (1/3 choices)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels