summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
6cb4ad9)
Currently, if a config file containing errors is being reloaded,
gui_cmdline_parser_ext() calls exit() which leaves the terminal
in an unusable state because para_gui had no chance to call
endwin() in order to reset the terminal.
Fix this flaw by instructing gengetopt to generate code that does
not exit on errors. We can still tell that the command line or the
config file contained errors by looking at the return value of the
various parsers.
--func-name $(subst _write.ggo,,$(<F))_cmdline_parser < $<
define ggo-opts
--func-name $(subst _write.ggo,,$(<F))_cmdline_parser < $<
define ggo-opts
+$(if $(filter gui,$(*F)), --no-handle-error) \
$(if $(filter recv filter write audiod,$(*F)), --no-handle-help) \
$(if $(filter afh,$(*F)), --unamed-opts=audio_file) \
$(if $(filter client audioc,$(*F)), --unamed-opts=command) \
$(if $(filter recv filter write audiod,$(*F)), --no-handle-help) \
$(if $(filter afh,$(*F)), --unamed-opts=audio_file) \
$(if $(filter client audioc,$(*F)), --unamed-opts=command) \
.override = 1,
.initialize = 1,
.check_required = 0,
.override = 1,
.initialize = 1,
.check_required = 0,
+ .check_ambiguity = 0,
+ .print_errors = 0,
return;
}
PARA_INFO_LOG("rereading command line options and config file");
return;
}
PARA_INFO_LOG("rereading command line options and config file");
- gui_cmdline_parser(_argc, _argv, &conf);
- gui_cmdline_parser_config_file(cf, &conf, ¶ms);
+ gui_cmdline_parser_ext(_argc, _argv, &conf, ¶ms);
+ if (gui_cmdline_parser_config_file(cf, &conf, ¶ms) != 0) {
+ PARA_EMERG_LOG("errors in config file");
+ finish(EXIT_FAILURE);
+ }
PARA_NOTICE_LOG("config file reloaded");
if (check_key_map_args() < 0)
finish(EXIT_FAILURE);
PARA_NOTICE_LOG("config file reloaded");
if (check_key_map_args() < 0)
finish(EXIT_FAILURE);
_argc = argc;
_argv = argv;
_argc = argc;
_argv = argv;
- gui_cmdline_parser(argc, argv, &conf);
+ if (gui_cmdline_parser(argc, argv, &conf) != 0)
+ exit(EXIT_FAILURE);
HANDLE_VERSION_FLAG("gui", conf);
cf = configfile_exists();
if (!cf && conf.config_file_given) {
HANDLE_VERSION_FLAG("gui", conf);
cf = configfile_exists();
if (!cf && conf.config_file_given) {
.check_ambiguity = 0,
.print_errors = 1,
};
.check_ambiguity = 0,
.print_errors = 1,
};
- gui_cmdline_parser_config_file(cf, &conf, ¶ms);
+ if (gui_cmdline_parser_config_file(cf, &conf, ¶ms) != 0)
+ exit(EXIT_FAILURE);
}
loglevel = get_loglevel_by_name(conf.loglevel_arg);
if (check_key_map_args() < 0) {
}
loglevel = get_loglevel_by_name(conf.loglevel_arg);
if (check_key_map_args() < 0) {