From 574eff0df1aff9bdc6d32939a03312cc08803de3 Mon Sep 17 00:00:00 2001 From: Phil Jones Date: Mon, 17 Apr 2023 23:43:05 +0100 Subject: Add --matching-algorithm option. This replaces the --fuzzy-match algorithm. Available choices are normal, prefix and fuzzy. Levenshtein distance was investigated, but it seems pretty rubbish for tofi's use case, where you normally want a good match when you've only typed a small portion of the target string. --- src/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/main.c') diff --git a/src/main.c b/src/main.c index a59ac78..76df63d 100644 --- a/src/main.c +++ b/src/main.c @@ -834,7 +834,6 @@ static void usage(bool err) " --output Name of output to display window on.\n" " --anchor Location on screen to anchor window.\n" " --horizontal List results horizontally.\n" -" --fuzzy-match Use fuzzy matching for searching.\n" "\n" "All options listed in \"man 5 tofi\" are also accpted in the form \"--key=value\".\n" ); @@ -912,6 +911,7 @@ const struct option long_options[] = { {"history", required_argument, NULL, 0}, {"history-file", required_argument, NULL, 0}, {"fuzzy-match", required_argument, NULL, 0}, + {"matching-algorithm", required_argument, NULL, 0}, {"require-match", required_argument, NULL, 0}, {"auto-accept-single", required_argument, NULL, 0}, {"hide-input", required_argument, NULL, 0}, -- cgit v1.2.3