From cc42dbe9e282a5c30ce2d1baa9805927a79a19c3 Mon Sep 17 00:00:00 2001 From: frosty Date: Tue, 24 Feb 2026 01:03:30 -0500 Subject: add fuzzy matching, bump version --- src/Main.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'src/Main.c') diff --git a/src/Main.c b/src/Main.c index 4ecd4f3..e941921 100644 --- a/src/Main.c +++ b/src/Main.c @@ -11,7 +11,8 @@ Options opts = { .prompt = "", - .insensitive = 0 + .insensitive = 0, + .fuzzy = 0 }; ItemList all_items = {0}; @@ -45,7 +46,7 @@ void read_items(void) { } void version(void) { - puts("insel 1.0"); + puts("insel 1.1"); puts("'those who select their inputs'\n"); puts("GNU GPL version 2 .\n" "This is free software: you are free to change and redistribute it.\n" @@ -54,12 +55,14 @@ void version(void) { } void help(void) { - puts("Usage: insel [-i] [-p prompt]" + puts("Usage: insel [-i] [-F] [-p prompt]" "\n" "Options:" "\n" " -i Case-insensitive matching" "\n" + " -F Fuzzy matching (implies -i)" + "\n" " -v Show version" "\n" " -p prompt Prompt to display" @@ -76,6 +79,10 @@ int main(int argc, char *argv[]) { if (strcmp(argv[i], "-v") == 0) version(); else if (strcmp(argv[i], "--help") == 0) help(); else if (strcmp(argv[i], "-i") == 0) opts.insensitive = 1; + else if (strcmp(argv[i], "-F") == 0) { + opts.fuzzy = 1; + opts.insensitive = 1; + } else if (strcmp(argv[i], "-b") == 0 && i + 1 < argc) i++; else if (strcmp(argv[i], "-f") == 0 && i + 1 < argc) i++; else if (strcmp(argv[i], "-l") == 0 && i + 1 < argc) i++; -- cgit v1.2.3