X-Git-Url: http://git.tuebingen.mpg.de/?a=blobdiff_plain;f=audioc.c;h=164a1554f0ee2ceba94f6a509ea4911fba8a66f9;hb=042767ce4032ee7bec7df1716411a175259cfbf1;hp=6a8867182e42bb1a7d6041d4ae0e55fbcba1164d;hpb=b01605d7062e4d1f005d5aaaaed158d8efe06d79;p=paraslash.git diff --git a/audioc.c b/audioc.c index 6a886718..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; @@ -194,7 +195,7 @@ __noreturn static void interactive_session(void) .loglevel = loglevel, .completers = audiod_completers, }; - PARA_NOTICE_LOG("\n%s\n", VERSION_TEXT("audioc")); + PARA_NOTICE_LOG("\n%s\n", version_text("audioc")); if (conf.history_file_given) history_file = para_strdup(conf.history_file_arg); else { @@ -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. * @@ -286,8 +296,10 @@ int main(int argc, char *argv[]) size_t bufsize; audioc_cmdline_parser(argc, argv, &conf); - HANDLE_VERSION_FLAG("audioc", 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 = {