+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;
+ }
+ gui_cmdline_parser_config_file(config_file, &conf, ¶ms);
+ loglevel = get_loglevel_by_name(conf.loglevel_arg);
+ check_key_map_args_or_die();
+ theme_init(conf.theme_arg, &theme);
+ err = false;
+out:
+ free(config_file);
+ if (err)
+ exit(EXIT_FAILURE);
+}
+