So that these functions can also be used by audiod.
__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? filter_args_info_detailed_help
: filter_args_info_help;
printf_or_die("%s\n\n", filter_args_info_usage);
for (; *p; p++)
printf_or_die("%s\n", *p);
-
- printf_or_die("\nAvailable filters: \n\t");
- FOR_EACH_SUPPORTED_FILTER(i)
- printf_or_die("%s%s", i? " " : "", filters[i].name);
- printf_or_die("\n\n");
-
- FOR_EACH_SUPPORTED_FILTER(i) {
- struct filter *f = filters + i;
-
- if (!f->help.short_help)
- continue;
- printf_or_die("Options for %s:\n", f->name);
- ggo_print_help(&f->help, d);
- }
+ print_filter_helps(d);
exit(0);
}
void filter_init(struct filter *all_filters);
int check_filter_arg(char *filter_arg, void **conf);
void filter_pre_select(__a_unused struct sched *s, struct task *t);
-
+void print_filter_helps(int detailed);
static inline void write_int16_host_endian(char *buf, int val)
{
return -E_UNSUPPORTED_FILTER;
}
+void print_filter_helps(int detailed)
+{
+ int i;
+
+ printf_or_die("\nAvailable filters: \n\t");
+ FOR_EACH_SUPPORTED_FILTER(i)
+ printf_or_die("%s%s", i? " " : "", filters[i].name);
+ printf_or_die("\n\n");
+
+ FOR_EACH_SUPPORTED_FILTER(i) {
+ struct filter *f = filters + i;
+
+ if (!f->help.short_help)
+ continue;
+ printf_or_die("Options for %s:\n", f->name);
+ ggo_print_help(&f->help, detailed);
+ }
+
+}
__noreturn static void print_help_and_die(void)
{
- printf("dsfsfsd\n");
- int i, d = conf.detailed_help_given;
+ int d = conf.detailed_help_given;
const char **p = d? recv_args_info_detailed_help
: recv_args_info_help;
printf_or_die("%s\n\n", recv_args_info_usage);
for (; *p; p++)
printf_or_die("%s\n", *p);
-
- printf_or_die("\nAvailable receivers: \n\t");
- FOR_EACH_RECEIVER(i)
- printf_or_die("%s%s", i? " " : "", receivers[i].name);
- printf_or_die("\n\n");
- FOR_EACH_RECEIVER(i) {
- struct receiver *r = receivers + i;
-
- if (!r->help.short_help)
- continue;
- printf_or_die("Options for %s:\n", r->name);
- ggo_print_help(&r->help, d);
- }
+ print_receiver_helps(d);
exit(0);
}
#define FOR_EACH_RECEIVER(i) for (i = 0; receivers[i].name; i++)
void *check_receiver_arg(char *ra, int *receiver_num);
+void print_receiver_helps(int detailed);
PARA_ERROR_LOG("receiver not found\n");
return NULL;
}
+
+void print_receiver_helps(int detailed)
+{
+ int i;
+
+ printf_or_die("\nAvailable receivers: \n\t");
+ FOR_EACH_RECEIVER(i)
+ printf_or_die("%s%s", i? " " : "", receivers[i].name);
+ printf_or_die("\n\n");
+ FOR_EACH_RECEIVER(i) {
+ struct receiver *r = receivers + i;
+
+ if (!r->help.short_help)
+ continue;
+ printf_or_die("Options for %s:\n", r->name);
+ ggo_print_help(&r->help, detailed);
+ }
+}
__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;
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);
}
wng->writer_nodes[0].conf = writers[DEFAULT_WRITER].parse_config("");
return wng;
}
+
+void print_writer_helps(int detailed)
+{
+ int i;
+
+ 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, detailed);
+ }
+}
void init_supported_writers(void);
void *check_writer_arg(const char *wa, int *writer_num);
struct writer_node_group *setup_default_wng(void);
+void print_writer_helps(int detailed);