audiod: Include help for receivers/filter/writers in help output.
authorAndre Noll <maan@systemlinux.org>
Sun, 7 Dec 2008 11:21:48 +0000 (12:21 +0100)
committerAndre Noll <maan@systemlinux.org>
Sun, 7 Dec 2008 11:21:48 +0000 (12:21 +0100)
Makefile.in
NEWS
audiod.c

index f4bae24a6df311f86725f3860f20adfcc3fbd3b9..4e6ef96258b4f7c2fcf4ee324d0a6ac4b4ae7b01 100644 (file)
@@ -119,6 +119,7 @@ grab_client.cmdline.h grab_client.cmdline.c: grab_client.ggo
                recv.ggo) O="--no-handle-help";; \
                filter.ggo) O="--no-handle-help";; \
                write.ggo) O="--no-handle-help";; \
+               audiod.ggo) O="--no-handle-help";; \
        esac; \
        if test $< != fsck.ggo; then O="$$O --conf-parser "; fi; \
        gengetopt $$O \
diff --git a/NEWS b/NEWS
index 209e9460e2cb457a9bb264582fb5ebf2722ad8f1..3874bed194fc18785e537492725066e757504228 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -5,7 +5,9 @@ NEWS
 0.3.4 (to be announced) "elliptic inheritance"
 ----------------------------------------------
        - new options for mp3dec: --ignore-crc, --bufsize
-       - Improved man pages for para_recv/para_filter and para_write.
+       - Improved help/man pages: The documentation of para_audiod,
+         para_recv, para_filter and para_write now also contains
+         all options of the available receivers/filters/writers.
 
 --------------------------------------------
 0.3.3 (2008-12-01) "axiomatic perspectivity"
index 22611eb0db41f98c6ece8cfc70422eee478b5d63..e3db6bea822d4f6fd5954e19436f28358b13d906 100644 (file)
--- a/audiod.c
+++ b/audiod.c
@@ -1069,6 +1069,24 @@ static void set_initial_status(void)
                PARA_WARNING_LOG("invalid mode\n");
 }
 
+__noreturn static void print_help_and_die(void)
+{
+       int d = conf.detailed_help_given;
+       const char **p = d? audiod_args_info_detailed_help
+               : audiod_args_info_help;
+
+       printf_or_die("%s\n\n", AUDIOD_CMDLINE_PARSER_PACKAGE "-"
+               AUDIOD_CMDLINE_PARSER_VERSION);
+       printf_or_die("%s\n\n", audiod_args_info_usage);
+       for (; *p; p++)
+               printf_or_die("%s\n", *p);
+       print_receiver_helps(d);
+       print_filter_helps(d);
+       print_writer_helps(d);
+       exit(0);
+}
+
+
 /**
  * the main function of para_audiod
  *
@@ -1112,8 +1130,10 @@ int main(int argc, char *argv[])
        }
        if (conf.logfile_given)
                logfile = open_log(conf.logfile_arg);
-       log_welcome("para_audiod", conf.loglevel_arg);
        i = init_stream_io();
+       if (conf.help_given || conf.detailed_help_given)
+               print_help_and_die();
+       log_welcome("para_audiod", conf.loglevel_arg);
        if (i < 0) {
                PARA_EMERG_LOG("init stream io error: %s\n", para_strerror(-i));
                exit(EXIT_FAILURE);