summaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
authorPhil Jones <philj56@gmail.com>2023-04-17 23:43:05 +0100
committerPhil Jones <philj56@gmail.com>2023-04-17 23:43:05 +0100
commit574eff0df1aff9bdc6d32939a03312cc08803de3 (patch)
tree5aeca72f70314bee3bf95db99f10d89f0a7b4032 /src/main.c
parent71a4801d20d8904cfcfa5e92c96d53ee06a2c69f (diff)
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.
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c2
1 files changed, 1 insertions, 1 deletions
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> Name of output to display window on.\n"
" --anchor <position> Location on screen to anchor window.\n"
" --horizontal <true|false> List results horizontally.\n"
-" --fuzzy-match <true|false> 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},