summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzachir <zachir@librem.one>2025-07-19 00:50:48 -0500
committerzachir <zachir@librem.one>2025-07-19 00:50:48 -0500
commit7476a12383b280cec88ff2932f8fffb84537b91c (patch)
treed34c8d4ca6884d5de0b1005f20ad28dbfa494194
parentcdd4ea4afc9b45a0e2353b32f71e8d0bdab79c85 (diff)
Fix dmenu options
-rw-r--r--src/main.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/main.c b/src/main.c
index 4253eee..f23e1ea 100644
--- a/src/main.c
+++ b/src/main.c
@@ -1024,7 +1024,10 @@ static void parse_args(struct tofi *tofi, int argc, char *argv[])
/* Second pass, parse everything else. */
optind = 1;
- opt = getopt_long(argc, argv, short_options, long_options, &option_index);
+ if (dmenu_mode)
+ opt = getopt_long(argc, argv, dmenu_short_options, long_options, &option_index);
+ else
+ opt = getopt_long(argc, argv, short_options, long_options, &option_index);
while (opt != -1) {
if (!dmenu_mode) {
if (opt == 0) {
@@ -1067,7 +1070,10 @@ static void parse_args(struct tofi *tofi, int argc, char *argv[])
}
}
}
- opt = getopt_long(argc, argv, short_options, long_options, &option_index);
+ if (dmenu_mode)
+ opt = getopt_long(argc, argv, dmenu_short_options, long_options, &option_index);
+ else
+ opt = getopt_long(argc, argv, short_options, long_options, &option_index);
}
if (optind < argc) {