diff options
author | zachir <zachir@librem.one> | 2025-07-19 00:50:48 -0500 |
---|---|---|
committer | zachir <zachir@librem.one> | 2025-07-19 00:50:48 -0500 |
commit | 7476a12383b280cec88ff2932f8fffb84537b91c (patch) | |
tree | d34c8d4ca6884d5de0b1005f20ad28dbfa494194 | |
parent | cdd4ea4afc9b45a0e2353b32f71e8d0bdab79c85 (diff) |
Fix dmenu options
-rw-r--r-- | src/main.c | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -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) { |