summaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
authorPhil Jones <philj56@gmail.com>2022-06-21 23:08:07 +0100
committerPhil Jones <philj56@gmail.com>2022-06-21 23:08:07 +0100
commit05ce291004bee5587fff9e0bbf06676f82e3f457 (patch)
tree5d9e615c341b92b37e6aa83fc6ec9fa968f8fd48 /src/main.c
parent25b2c9f895fd91fb556809ce513d3681ad279938 (diff)
Minor parsing bugfixes.
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/main.c b/src/main.c
index be5719c..593da15 100644
--- a/src/main.c
+++ b/src/main.c
@@ -600,10 +600,11 @@ static void parse_args(struct tofi *tofi, int argc, char *argv[])
{"hide-cursor", required_argument, NULL, 0},
{NULL, 0, NULL, 0}
};
- const char *short_options = "hc:";
+ const char *short_options = ":hc:";
bool load_default_config = true;
int option_index = 0;
+ opterr = 0;
/* First pass, just check for config file, help, and errors. */
int opt = getopt_long(argc, argv, short_options, long_options, &option_index);
@@ -680,6 +681,8 @@ int main(int argc, char *argv[])
}
};
+ parse_args(&tofi, argc, argv);
+
log_debug("Generating command list.\n");
log_indent();
tofi.window.entry.history = history_load();
@@ -689,7 +692,6 @@ int main(int argc, char *argv[])
log_unindent();
log_debug("Command list generated.\n");
- parse_args(&tofi, argc, argv);
/*
* Initial Wayland & XKB setup.