-static void parse_config_file_or_die(bool override)
-{
- bool err;
- char *config_file;
- struct gui_cmdline_parser_params params = {
- .override = override,
- .initialize = 0,
- .check_required = !override,
- .check_ambiguity = 0,
- .print_errors = 1,
- };
-
- if (conf.config_file_given)
- config_file = para_strdup(conf.config_file_arg);
- else {
- char *home = para_homedir();
- config_file = make_message("%s/.paraslash/gui.conf", home);
- free(home);
- }
- if (!file_exists(config_file)) {
- if (!conf.config_file_given)
- err = false;
- else {
- PARA_EMERG_LOG("config file %s does not exist\n",
- config_file);
- err = true;
- }
- goto out;
+static void parse_config_file_or_die(bool reload)
+{
+ int ret;
+ unsigned flags = MCF_DONT_FREE;
+
+ if (lpr != cmdline_lpr)
+ lls_free_parse_result(lpr, CMD_PTR);
+ lpr = cmdline_lpr;
+ if (reload)
+ flags |= MCF_OVERRIDE;
+ ret = lsu_merge_config_file_options(OPT_STRING_VAL(CONFIG_FILE),
+ "gui.conf", &lpr, CMD_PTR, gui_suite, flags);
+ if (ret < 0) {
+ PARA_EMERG_LOG("failed to parse config file: %s\n",
+ para_strerror(-ret));
+ exit(EXIT_FAILURE);