]> git.tue.mpg.de Git - paraslash.git/commitdiff
audiod: use the new help text array of gengetopt-2.17
authorAndre <maan@p133.(none)>
Mon, 27 Mar 2006 04:58:32 +0000 (06:58 +0200)
committerAndre <maan@p133.(none)>
Mon, 27 Mar 2006 04:58:32 +0000 (06:58 +0200)
This allows to get rid of an ugly hack for the grab command.

Makefile.in
audiod.c

index 42ab70ec0ad22a5d29af33e66715005e7d4f861f..d8932e4366c01897de9013f71cfab62a019d5abb 100644 (file)
@@ -123,9 +123,6 @@ grab_client.cmdline.h grab_client.cmdline.c: grab_client.ggo
                --arg-struct-name=grab_client_args_info \
                --file-name=$(subst .ggo,,$<).cmdline \
                --func-name $(subst .ggo,,$<)_cmdline_parser < $<
-       grep -v 'fprintf\ *(stderr' $(subst .ggo,,$<).cmdline.c > $(subst .ggo,,$<).tmp
-       mv $(subst .ggo,,$<).tmp $(subst .ggo,,$<).cmdline.c
-       ggo_help GRAB_HELP_TXT < grab_client.ggo >> $(subst .ggo,,$<).cmdline.h
 
 %_recv.cmdline.h %_recv.cmdline.c: %_recv.ggo
        gengetopt $(module_ggo_opts) \
index 741bd68b0344c510ecdd750e897aedfa25b9ee48..adfcbf41f767bb489ed6d84eefb740321bb6041a 100644 (file)
--- a/audiod.c
+++ b/audiod.c
@@ -153,11 +153,13 @@ static struct audiod_command cmds[] = {
 .description = "grab the audio stream",
 .synopsis = "-- grab [grab_options]",
 .help =
+
 "grab ('splice') the audio stream at any position in the filter      \n"
-"chain and send that data back to the client. \n"
-"Available options:\n\n"
-GRAB_HELP_TXT
+"chain and send that data back to the client. Try\n"
+"\t para_audioc -- grab -h\n"
+"for the list of available options.\n"
 },
+
 {
 .name = "help",
 .handler = com_help,
@@ -1345,7 +1347,8 @@ static int com_grab(int fd, int argc, char **argv)
 {
        struct grab_client *gc;
        struct filter_node *fn;
-       int err;
+       int i, err;
+       char *help;
 
        PARA_INFO_LOG("argc: %d, argv[0]: %s, optind: %d\n", argc, argv[0], optind);
        gc = grab_client_new(fd, argc, argv, &err);
@@ -1359,11 +1362,15 @@ static int com_grab(int fd, int argc, char **argv)
 err_out:
        if (err != -E_GC_HELP_GIVEN)
                return err;
-       err = client_write(fd, "Usage: para_audioc [audioc_options] -- "
-               "grab [grab_options]\nAvailable options:\n");
-       if (err < 0)
-               return err;
-       err = client_write(fd, GRAB_HELP_TXT);
+       help = make_message("%s\n\n", grab_client_args_info_usage);
+       for (i = 0; grab_client_args_info_help[i]; i++) {
+               char *tmp = make_message("%s%s\n", help,
+                       grab_client_args_info_help[i]);
+               free(help);
+               help = tmp;
+       }
+       err = client_write(fd, help);
+       free(help);
        if (err < 0)
                return err;
        close(fd);