diff options
Diffstat (limited to 'src/cmdline.c')
-rw-r--r-- | src/cmdline.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/cmdline.c b/src/cmdline.c index e0274ef36..606f26674 100644 --- a/src/cmdline.c +++ b/src/cmdline.c @@ -35,7 +35,6 @@ #include <stdio.h> #include <stdlib.h> -#define SYSTEM_CONFIG_FILE_LOCATION "/etc/mpd.conf" #define USER_CONFIG_FILE_LOCATION1 ".mpdconf" #define USER_CONFIG_FILE_LOCATION2 ".mpd/mpd.conf" @@ -77,7 +76,7 @@ static const char *summary = "Music Player Daemon - a daemon for playing music."; #endif -void parseOptions(int argc, char **argv, Options *options) +void parse_cmdline(int argc, char **argv, struct options *options) { GError *error = NULL; GOptionContext *context; @@ -96,7 +95,9 @@ void parseOptions(int argc, char **argv, Options *options) "don't create database, even if it doesn't exist", NULL }, { "no-daemon", 0, 0, G_OPTION_ARG_NONE, &option_no_daemon, "don't detach from console", NULL }, - { "stdout", 0, 0, G_OPTION_ARG_NONE, &options->stdOutput, + { "stdout", 0, 0, G_OPTION_ARG_NONE, &options->log_stderr, + NULL, NULL }, + { "stderr", 0, 0, G_OPTION_ARG_NONE, &options->log_stderr, "print messages to stderr", NULL }, { "verbose", 'v', 0, G_OPTION_ARG_NONE, &options->verbose, "verbose logging", NULL }, @@ -107,9 +108,9 @@ void parseOptions(int argc, char **argv, Options *options) options->kill = false; options->daemon = true; - options->stdOutput = false; + options->log_stderr = false; options->verbose = false; - options->createDB = 0; + options->create_db = 0; context = g_option_context_new("[path/to/mpd.conf]"); g_option_context_add_main_entries(context, entries, NULL); @@ -137,9 +138,9 @@ void parseOptions(int argc, char **argv, Options *options) g_error("Cannot use both --create-db and --no-create-db\n"); if (option_no_create_db) - options->createDB = -1; + options->create_db = -1; else if (option_create_db) - options->createDB = 1; + options->create_db = 1; options->daemon = !option_no_daemon; |