From 7476a12383b280cec88ff2932f8fffb84537b91c Mon Sep 17 00:00:00 2001 From: zachir Date: Sat, 19 Jul 2025 00:50:48 -0500 Subject: Fix dmenu options --- src/main.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/main.c') 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) { -- cgit v1.2.3