From ee91cb6c9ded44d7f3ddb23b681df49fe5c8146b Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Wed, 1 Sep 2004 17:36:46 +0000 Subject: add esd compatible startup script add default configuration script git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@172 fefdeb5f-60dc-0310-8127-8f9354f1896f --- polyp/cmdline.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'polyp/cmdline.c') diff --git a/polyp/cmdline.c b/polyp/cmdline.c index 9935e7b6..6538b930 100644 --- a/polyp/cmdline.c +++ b/polyp/cmdline.c @@ -48,6 +48,7 @@ void pa_cmdline_help(const char *argv0) { " -L MODULE Load the specified plugin module with the specified argument\n" " -F FILE Run the specified script\n" " -C Open a command line on the running TTY\n" + " -n Don't load configuration file ("PA_DEFAULT_CONFIG_FILE")\n" " -D Daemonize after loading the modules\n" " -f Dont quit when the startup fails\n" " -v Verbose startup\n" @@ -59,6 +60,7 @@ struct pa_cmdline* pa_cmdline_parse(int argc, char * const argv []) { char c; struct pa_cmdline *cmdline = NULL; struct pa_strbuf *buf = NULL; + int no_default_config_file = 0; assert(argc && argv); cmdline = pa_xmalloc(sizeof(struct pa_cmdline)); @@ -68,7 +70,7 @@ struct pa_cmdline* pa_cmdline_parse(int argc, char * const argv []) { buf = pa_strbuf_new(); assert(buf); - while ((c = getopt(argc, argv, "L:F:CDhfvrRV")) != -1) { + while ((c = getopt(argc, argv, "L:F:CDhfvrRVn")) != -1) { switch (c) { case 'L': pa_strbuf_printf(buf, "load %s\n", optarg); @@ -100,12 +102,19 @@ struct pa_cmdline* pa_cmdline_parse(int argc, char * const argv []) { case 'V': cmdline->version = 1; break; + case 'n': + no_default_config_file =1; + break; default: goto fail; } } + if (!no_default_config_file) + pa_strbuf_puts(buf, ".include "PA_DEFAULT_CONFIG_FILE"\n"); + + cmdline->cli_commands = pa_strbuf_tostring_free(buf); return cmdline; -- cgit