X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=write.c;h=6799db4175282b779c2fd454d11988be31b933d8;hp=b401b078f2a09f819b26981bd1111faa5e6bbdaa;hb=6bcd10bc4ada11a04bc2b7425afe5a8855592cd2;hpb=855c53a93c7d0283c412cfb4ac465f69661e5ab4 diff --git a/write.c b/write.c index b401b078..6799db41 100644 --- a/write.c +++ b/write.c @@ -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); } @@ -102,12 +97,11 @@ static int setup_and_schedule(void) struct write_task wt = { .task = { .pre_select = write_pre_select, - .new_post_select = write_post_select, + .post_select = write_post_select, .status = "write task", }, }; - loglevel = get_loglevel_by_name(conf.loglevel_arg); sit.btrn = btr_new_node(&(struct btr_node_description) EMBRACE(.name = "stdin")); stdin_set_defaults(&sit); @@ -173,9 +167,10 @@ int main(int argc, char *argv[]) { int ret; - writer_init(); write_cmdline_parser(argc, argv, &conf); - HANDLE_VERSION_FLAG("write", conf); + loglevel = get_loglevel_by_name(conf.loglevel_arg); + writer_init(); + version_handle_flag("write", conf.version_given); if (conf.help_given || conf.detailed_help_given) print_help_and_die();