X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=write.c;h=4ed5f72e10638eb03149d6a431511d8d7b59539e;hp=f4f757fff2957f75876df33a83b41fd91aad3571;hb=c2ff586ae77f1ab640d5f8b3ceb12786fcc4cbaa;hpb=b01605d7062e4d1f005d5aaaaed158d8efe06d79 diff --git a/write.c b/write.c index f4f757ff..4ed5f72e 100644 --- a/write.c +++ b/write.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2005-2013 Andre Noll + * Copyright (C) 2005-2014 Andre Noll * * Licensed under the GPL v2. For licencing details see COPYING. */ @@ -35,16 +35,11 @@ INIT_STDERR_LOGGING(loglevel) __noreturn static void print_help_and_die(void) { - int d = conf.detailed_help_given; - const char **p = d? write_args_info_detailed_help - : write_args_info_help; - - printf_or_die("%s\n\n", WRITE_CMDLINE_PARSER_PACKAGE "-" - WRITE_CMDLINE_PARSER_VERSION); - printf_or_die("%s\n\n", write_args_info_usage); - for (; *p; p++) - printf_or_die("%s\n", *p); - print_writer_helps(d); + struct ggo_help h = DEFINE_GGO_HELP(write); + bool d = conf.detailed_help_given; + + ggo_print_help(&h, d? GPH_STANDARD_FLAGS_DETAILED : GPH_STANDARD_FLAGS); + print_writer_helps(d? GPH_MODULE_FLAGS_DETAILED : GPH_MODULE_FLAGS); exit(0); } @@ -175,7 +170,7 @@ int main(int argc, char *argv[]) write_cmdline_parser(argc, argv, &conf); loglevel = get_loglevel_by_name(conf.loglevel_arg); writer_init(); - HANDLE_VERSION_FLAG("write", conf); + version_handle_flag("write", conf.version_given); if (conf.help_given || conf.detailed_help_given) print_help_and_die();