- struct writer_node_group *g = t->private_data;
-
- PARA_INFO_LOG("%s\n", PARA_STRERROR(-t->ret));
- unregister_task(t);
- wng_close(g);
-}
-
-
-static void idt_event_handler(struct task *t)
-{
- int ret;
-
- PARA_INFO_LOG("%s\n", PARA_STRERROR(-t->ret));
- unregister_task(t);
- wng->buf = sit.buf;
- wng->loaded = &sit.loaded;
- wng->input_eof = &sit.eof;
- wng->task.event_handler = wng_event_handler;
- wng->channels = &cwt.channels;
- wng->samplerate = &cwt.samplerate;
- ret = wng_open(wng);
- if (ret < 0) {
- PARA_ERROR_LOG("%s\n", PARA_STRERROR(-ret));
- exit(EXIT_FAILURE);
- }
-}
-
-static void cwt_event_handler(struct task *t)
-{
- if (t->ret != -E_NO_WAV_HEADER && t->ret != -E_WAV_HEADER_SUCCESS) {
- PARA_ERROR_LOG("%s\n", PARA_STRERROR(-t->ret));
- exit(EXIT_FAILURE);
- }
- PARA_INFO_LOG("%s\n", PARA_STRERROR(-t->ret));
- unregister_task(t);
-// if (t->ret == -E_WAV_HEADER_SUCCESS) {
-// conf.channels_arg = cwt.channels;
-// conf.sample_rate_arg = cwt.sample_rate;
-// }
- idt.task.pre_select = initial_delay_pre_select;
- idt.task.private_data = &idt;
- idt.task.event_handler = idt_event_handler;
- sprintf(idt.task.status, "initial_delay");
- register_task(&idt.task);
+ 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);
+ exit(0);