X-Git-Url: http://git.tuebingen.mpg.de/?a=blobdiff_plain;f=gui.c;h=b874d0820c6341f124ccb9748dd91bce0a0d395b;hb=042767ce;hp=5092315e681f086c365f4af2644ec7e540532817;hpb=b01605d7062e4d1f005d5aaaaed158d8efe06d79;p=paraslash.git diff --git a/gui.c b/gui.c index 5092315e..b874d082 100644 --- a/gui.c +++ b/gui.c @@ -23,6 +23,7 @@ #include "list.h" #include "sched.h" #include "signal.h" +#include "ggo.h" #include "version.h" /** define the array of error lists needed by para_gui */ @@ -1511,6 +1512,15 @@ static void handle_command(int c) km_keyname(c)); } +__noreturn static void print_help_and_die(void) +{ + struct ggo_help h = DEFINE_GGO_HELP(gui); + bool d = conf.detailed_help_given; + + ggo_print_help(&h, d? GPH_STANDARD_FLAGS_DETAILED : GPH_STANDARD_FLAGS); + exit(0); +} + int main(int argc, char *argv[]) { int ret; @@ -1520,8 +1530,10 @@ int main(int argc, char *argv[]) _argv = argv; gui_cmdline_parser(argc, argv, &conf); /* exits on errors */ - HANDLE_VERSION_FLAG("gui", conf); loglevel = get_loglevel_by_name(conf.loglevel_arg); + version_handle_flag("gui", conf.version_given); + if (conf.help_given || conf.detailed_help_given) + print_help_and_die(); cf = configfile_exists(); if (!cf && conf.config_file_given) { fprintf(stderr, "can not read config file %s\n",