aboutsummaryrefslogtreecommitdiff
path: root/src/Main.c
diff options
context:
space:
mode:
authorfrosty <gabriel@bwaaa.monster>2026-02-24 01:03:30 -0500
committerfrosty <gabriel@bwaaa.monster>2026-02-24 01:03:30 -0500
commitcc42dbe9e282a5c30ce2d1baa9805927a79a19c3 (patch)
tree4cbab72827bb8e5aa008f6a28e5a6500a7de3fc0 /src/Main.c
parent8b2434d855c22435a99447aac748f87a4388b569 (diff)
downloadinsel-cc42dbe9e282a5c30ce2d1baa9805927a79a19c3.tar.gz
add fuzzy matching, bump versionHEADmaster
Diffstat (limited to 'src/Main.c')
-rw-r--r--src/Main.c13
1 files changed, 10 insertions, 3 deletions
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 <https://gnu.org/licenses/old-licenses/gpl-2.0.html>.\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++;