fzy

terminal fuzzy finder picker

git clone https://9o.is/git/fzy.git

commit 0331447832bfbf10868c0b44b772e6ffc3afd3b2
parent 456103698a6fc0300724a2adeac09be7c574ac37
Author: John Hawthorn <john.hawthorn@gmail.com>
Date:   Mon, 16 May 2016 19:37:35 -0700

Rename initial_query to filter

More acurately represents what it really does.

Diffstat:
Mfzy.c | 12++++++------
1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/fzy.c b/fzy.c @@ -195,7 +195,7 @@ static struct option longopts[] = {{"show-matches", required_argument, NULL, 'e' int main(int argc, char *argv[]) { int benchmark = 0; - const char *initial_query = NULL; + const char *filter = NULL; const char *tty_filename = "/dev/tty"; char c; while ((c = getopt_long(argc, argv, "vhse:l:t:p:", longopts, NULL)) != -1) { @@ -207,7 +207,7 @@ int main(int argc, char *argv[]) { flag_show_scores = 1; break; case 'e': - initial_query = optarg; + filter = optarg; break; case 'b': if (optarg) { @@ -256,14 +256,14 @@ int main(int argc, char *argv[]) { num_lines = choices.size; if (benchmark) { - if (!initial_query) { + if (!filter) { fprintf(stderr, "Must specify -e/--show-matches with --benchmark\n"); exit(EXIT_FAILURE); } for (int i = 0; i < benchmark; i++) - choices_search(&choices, initial_query); - } else if (initial_query) { - choices_search(&choices, initial_query); + choices_search(&choices, filter); + } else if (filter) { + choices_search(&choices, filter); for (size_t i = 0; i < choices_available(&choices); i++) { if (flag_show_scores) printf("%f\t", choices_getscore(&choices, i));