X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=write.c;h=c5a265652ec68c3b92e87f9ed93bbea9fcbc8364;hp=6e78e773c558f3d1c6d5fd8a15d0532645cec570;hb=74361f472d6d1a75a313cb3a6b4528cfeacfff0a;hpb=ebe54cf6ee1b9c5daf7837cb618c299a5b5187e0 diff --git a/write.c b/write.c index 6e78e773..c5a26565 100644 --- a/write.c +++ b/write.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2005-2008 Andre Noll + * Copyright (C) 2005-2009 Andre Noll * * Licensed under the GPL v2. For licencing details see COPYING. */ @@ -122,7 +122,8 @@ register_check_wav: s->timeout.tv_usec = 1; } -INIT_STDERR_LOGGING(conf.loglevel_arg) +static int loglevel; +INIT_STDERR_LOGGING(loglevel) static struct writer_node_group *check_args(void) { @@ -130,6 +131,7 @@ static struct writer_node_group *check_args(void) struct writer_node_group *g = NULL; struct initial_delay_task *idt = &the_initial_delay_task; + loglevel = get_loglevel_by_name(conf.loglevel_arg); if (conf.start_time_given) { long unsigned sec, usec; if (sscanf(conf.start_time_arg, "%lu:%lu", @@ -163,7 +165,7 @@ out: __noreturn static void print_help_and_die(void) { - int i, d = conf.detailed_help_given; + int d = conf.detailed_help_given; const char **p = d? write_args_info_detailed_help : write_args_info_help; @@ -172,19 +174,7 @@ __noreturn static void print_help_and_die(void) printf_or_die("%s\n\n", write_args_info_usage); for (; *p; p++) printf_or_die("%s\n", *p); - - printf_or_die("\nAvailable writers: \n\t"); - FOR_EACH_WRITER(i) - printf_or_die("%s%s", i? " " : "", writer_names[i]); - printf_or_die("\n\n"); - FOR_EACH_WRITER(i) { - struct writer *w = writers + i; - - if (!w->help.short_help) - continue; - printf_or_die("Options for %s:\n", writer_names[i]); - ggo_print_help(&w->help, d); - } + print_writer_helps(d); exit(0); } @@ -206,7 +196,7 @@ int main(int argc, char *argv[]) struct check_wav_task *cwt = &the_check_wav_task; struct initial_delay_task *idt = &the_initial_delay_task; - init_supported_writers(); + writer_init(); write_cmdline_parser(argc, argv, &conf); HANDLE_VERSION_FLAG("write", conf); if (conf.help_given || conf.detailed_help_given)