#include "afh.h"
#include "error.h"
#include "version.h"
+#include "ggo.h"
static struct afh_args_info conf;
INIT_AFH_ERRLISTS;
}
}
+__noreturn static void print_help_and_die(void)
+{
+ struct ggo_help h = DEFINE_GGO_HELP(afh);
+ int d = conf.detailed_help_given;
+ unsigned flags = d? GPH_STANDARD_FLAGS_DETAILED : GPH_STANDARD_FLAGS;
+
+ ggo_print_help(&h, flags);
+ exit(EXIT_SUCCESS);
+}
+
/**
* The main function of para_afh.
*
afh_cmdline_parser(argc, argv, &conf);
loglevel = get_loglevel_by_name(conf.loglevel_arg);
version_handle_flag("afh", conf.version_given);
+ if (conf.help_given || conf.detailed_help_given)
+ print_help_and_die();
+ afh_init();
ret = -E_AFH_SYNTAX;
if (conf.inputs_num == 0)
goto out;
#include "net.h"
#include "string.h"
#include "fd.h"
+#include "ggo.h"
#include "version.h"
INIT_AUDIOC_ERRLISTS;
return NULL;
}
+__noreturn static void print_help_and_die(void)
+{
+ struct ggo_help h = DEFINE_GGO_HELP(audioc);
+ bool d = conf.detailed_help_given;
+
+ ggo_print_help(&h, d? GPH_STANDARD_FLAGS_DETAILED : GPH_STANDARD_FLAGS);
+ exit(0);
+}
+
/**
* The client program to connect to para_audiod.
*
audioc_cmdline_parser(argc, argv, &conf);
loglevel = get_loglevel_by_name(conf.loglevel_arg);
version_handle_flag("audioc", conf.version_given);
+ if (conf.help_given || conf.detailed_help_given)
+ print_help_and_die();
cf = configfile_exists();
if (cf) {
struct audioc_cmdline_parser_params params = {
#include "client.h"
#include "buffer_tree.h"
#include "version.h"
+#include "ggo.h"
/** The size of the receiving buffer. */
#define CLIENT_BUFSIZE 4000
return ret;
}
+__noreturn static void print_help_and_die(struct client_task *ct)
+{
+ struct ggo_help h = DEFINE_GGO_HELP(client);
+ bool d = ct->conf.detailed_help_given;
+
+ ggo_print_help(&h, d? GPH_STANDARD_FLAGS_DETAILED : GPH_STANDARD_FLAGS);
+ exit(0);
+}
+
/**
* Parse a client configuration.
*
if (client_cmdline_parser(argc, argv, &ct->conf))
goto out;
version_handle_flag("client", ct->conf.version_given);
+ if (ct->conf.help_given || ct->conf.detailed_help_given)
+ print_help_and_die(ct);
ct->config_file = ct->conf.config_file_given?
para_strdup(ct->conf.config_file_arg) :
filters=" compress wav amp fecdec wmadec prebuffer"
audioc_cmdline_objs="add_cmdline(audioc)"
-audioc_errlist_objs="audioc string net fd version"
+audioc_errlist_objs="
+ audioc
+ string
+ net
+ fd
+ version
+ ggo
+"
audioc_ldflags=""
audiod_cmdline_objs="add_cmdline(audiod compress_filter http_recv dccp_recv file_write client amp_filter udp_recv prebuffer_filter)"
default_writer="FILE_WRITE"
client_cmdline_objs="add_cmdline(client)"
-client_errlist_objs="client net string fd sched stdin stdout time sideband
- client_common buffer_tree crypt_common version"
+client_errlist_objs="
+ client
+ net
+ string
+ fd
+ sched
+ stdin
+ stdout
+ time
+ sideband
+ client_common
+ buffer_tree
+ crypt_common
+ version
+ ggo
+"
client_ldflags=""
gui_cmdline_objs="add_cmdline(gui)"
-gui_errlist_objs="exec signal string stat ringbuffer fd gui gui_theme version time"
+gui_errlist_objs="
+ exec
+ signal
+ string
+ stat
+ ringbuffer
+ fd
+ gui
+ gui_theme
+ time
+ version
+ ggo
+"
gui_objs="$gui_cmdline_objs $gui_errlist_objs"
play_errlist_objs="play fd sched ggo buffer_tree time string net
afh_recv afh_common
extras="$extras server"
executables="$executables server"
server_cmdline_objs="add_cmdline(server)"
- server_errlist_objs="server afh_common mp3_afh vss command net
- string signal time daemon http_send close_on_fork mm
- crypt_common ipc dccp_send fd user_list chunk_queue
- afs aft mood score attribute blob playlist sched acl
- send_common udp_send color fec wma_afh wma_common sideband
- version"
+ server_errlist_objs="
+ server
+ afh_common
+ mp3_afh
+ vss command
+ net
+ string
+ signal
+ time
+ daemon
+ http_send
+ close_on_fork
+ mm
+ crypt_common
+ ipc dccp_send
+ fd
+ user_list
+ chunk_queue
+ afs
+ aft
+ mood
+ score
+ attribute
+ blob
+ playlist
+ sched
+ acl
+ send_common
+ udp_send
+ color
+ fec
+ wma_afh
+ wma_common
+ sideband
+ version
+ ggo
+ "
all_errlist_objs="$all_errlist_objs server vss command
http_send close_on_fork mm ipc dccp_send user_list
chunk_queue afs aft mood score attribute blob playlist
write_errlist_objs="$write_errlist_objs oss_write"
write_cmdline_objs="$write_cmdline_objs add_cmdline(oss_write)"
- fade_errlist_objs="$fade_errlist_objs oss_mix version"
+ fade_errlist_objs="$fade_errlist_objs oss_mix"
all_errlist_objs="$all_errlist_objs oss_write oss_mix"
writers="$writers oss"
extras="$extras fade"
executables="$executables fade"
all_errlist_objs="$all_errlist_objs fade"
- fade_errlist_objs="$fade_errlist_objs fade exec string fd"
+ fade_errlist_objs="$fade_errlist_objs fade exec string fd version ggo"
fade_cmdline_objs="add_cmdline(fade)"
fade_objs="$fade_cmdline_objs $fade_errlist_objs"
AC_SUBST(fade_objs, add_dot_o($fade_objs))
#include "string.h"
#include "mix.h"
#include "error.h"
+#include "ggo.h"
#include "version.h"
INIT_FADE_ERRLISTS;
exit(EXIT_FAILURE);
}
+__noreturn static void print_help_and_die(void)
+{
+ struct ggo_help h = DEFINE_GGO_HELP(fade);
+ bool d = conf.detailed_help_given;
+
+ ggo_print_help(&h, d? GPH_STANDARD_FLAGS_DETAILED : GPH_STANDARD_FLAGS);
+ exit(0);
+}
+
int main(int argc, char *argv[])
{
int ret;
fade_cmdline_parser(argc, argv, &conf);
loglevel = get_loglevel_by_name(conf.loglevel_arg);
version_handle_flag("fade", conf.version_given);
+ if (conf.help_given || conf.detailed_help_given)
+ print_help_and_die();
ret = configfile_exists();
if (!ret && conf.config_file_given) {
PARA_EMERG_LOG("can not read config file %s\n",
#include "list.h"
#include "sched.h"
#include "signal.h"
+#include "ggo.h"
#include "version.h"
/** define the array of error lists needed by para_gui */
km_keyname(c));
}
+__noreturn static void print_help_and_die(void)
+{
+ struct ggo_help h = DEFINE_GGO_HELP(gui);
+ bool d = conf.detailed_help_given;
+
+ ggo_print_help(&h, d? GPH_STANDARD_FLAGS_DETAILED : GPH_STANDARD_FLAGS);
+ exit(0);
+}
+
int main(int argc, char *argv[])
{
int ret;
gui_cmdline_parser(argc, argv, &conf); /* exits on errors */
loglevel = get_loglevel_by_name(conf.loglevel_arg);
version_handle_flag("gui", conf.version_given);
+ if (conf.help_given || conf.detailed_help_given)
+ print_help_and_die();
cf = configfile_exists();
if (!cf && conf.config_file_given) {
fprintf(stderr, "can not read config file %s\n",
-args "--unamed-opts=audio_file --no-handle-version"
+args "--unamed-opts=audio_file --no-handle-version --no-handle-help"
purpose "Print information about audio file(s)."
-args "--unamed-opts=command --conf-parser --no-handle-version"
+args "--unamed-opts=command --conf-parser --no-handle-version --no-handle-help"
purpose "Communicate with para_audiod through a local socket."
-args "--unamed-opts=command --no-handle-error --conf-parser --no-handle-version"
+args "--unamed-opts=command --no-handle-error --conf-parser --no-handle-version --no-handle-help"
purpose "Communicate with para_server through the paraslash control port."
-args "--conf-parser --no-handle-version"
+args "--conf-parser --no-handle-version --no-handle-help"
purpose "An alarm clock and volume-fader for OSS and ALSA."
-args "--conf-parser --no-handle-version"
+args "--conf-parser --no-handle-version --no-handle-help"
purpose "Show para_audiod status in a curses window."
.PRECIOUS: $(cmdline_dir)/%.cmdline.c $(cmdline_dir)/%.cmdline.h $(ggo_dir)/%.ggo
-$(cmdline_dir)/%.cmdline.h $(cmdline_dir)/%.cmdline.c: $(ggo_dir)/%.ggo git-version.h | $(cmdline_dir)
+$(cmdline_dir)/%.cmdline.h $(cmdline_dir)/%.cmdline.c: $(ggo_dir)/%.ggo | $(cmdline_dir)
@[ -z "$(Q)" ] || echo 'GGO $<'
$(Q) $(GENGETOPT) $(ggo_opts) < $<
ifeq ($(ggo_descriptions_declared),no)
-args "--conf-parser --no-handle-version"
+args "--conf-parser --no-handle-version --no-handle-help"
purpose "Manage and stream audio files."
#include "signal.h"
#include "user_list.h"
#include "color.h"
+#include "ggo.h"
#include "version.h"
__printf_2_3 void (*para_log)(int, const char*, ...) = daemon_log;
return afs_server_socket[0];
}
+__noreturn static void print_help_and_die(void)
+{
+ struct ggo_help h = DEFINE_GGO_HELP(server);
+ bool d = conf.detailed_help_given;
+
+ ggo_print_help(&h, d? GPH_STANDARD_FLAGS_DETAILED : GPH_STANDARD_FLAGS);
+ exit(0);
+}
+
static void server_init(int argc, char **argv)
{
struct server_cmdline_parser_params params = {
server_cmdline_parser_ext(argc, argv, &conf, ¶ms);
daemon_set_loglevel(conf.loglevel_arg);
version_handle_flag("server", conf.version_given);
+ if (conf.help_given || conf.detailed_help_given)
+ print_help_and_die();
drop_privileges_or_die(conf.user_arg, conf.group_arg);
/* parse config file, open log and set defaults */
parse_config_or_die(0);