X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=audioc.c;h=164a1554f0ee2ceba94f6a509ea4911fba8a66f9;hp=0147b4cf411b0a277b4378cd708e3874f05ba831;hb=042767ce;hpb=48f1fc440eb53b0efb7c1beaba396e81b8bcb1ab diff --git a/audioc.c b/audioc.c index 0147b4cf..164a1554 100644 --- a/audioc.c +++ b/audioc.c @@ -17,6 +17,7 @@ #include "net.h" #include "string.h" #include "fd.h" +#include "ggo.h" #include "version.h" INIT_AUDIOC_ERRLISTS; @@ -263,6 +264,15 @@ static char *configfile_exists(void) return NULL; } +__noreturn static void print_help_and_die(void) +{ + struct ggo_help h = DEFINE_GGO_HELP(audioc); + bool d = conf.detailed_help_given; + + ggo_print_help(&h, d? GPH_STANDARD_FLAGS_DETAILED : GPH_STANDARD_FLAGS); + exit(0); +} + /** * The client program to connect to para_audiod. * @@ -288,6 +298,8 @@ int main(int argc, char *argv[]) audioc_cmdline_parser(argc, argv, &conf); loglevel = get_loglevel_by_name(conf.loglevel_arg); version_handle_flag("audioc", conf.version_given); + if (conf.help_given || conf.detailed_help_given) + print_help_and_die(); cf = configfile_exists(); if (cf) { struct audioc_cmdline_parser_params params = {