From 7f880ab8baf426bef66dfeea08034b1ea8125589 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 5 Nov 2008 20:52:14 +0100 Subject: main: print usage to stdout Using the logging library here is inappropriate. --- src/main.c | 51 +++++++++++++++++++++++++-------------------------- 1 file changed, 25 insertions(+), 26 deletions(-) (limited to 'src/main.c') diff --git a/src/main.c b/src/main.c index 33c1125b7..afa171651 100644 --- a/src/main.c +++ b/src/main.c @@ -111,40 +111,39 @@ static int setenv(const char *name, const char *value, int replace) static void usage(char *argv[]) { - ERROR("usage:\n"); - ERROR(" %s [options] \n", argv[0]); - ERROR(" %s [options] (searches for ~%s then %s)\n", - argv[0], USER_CONFIG_FILE_LOCATION, SYSTEM_CONFIG_FILE_LOCATION); - ERROR("\n"); - ERROR("options:\n"); - ERROR(" --help this usage statement\n"); - ERROR(" --kill kill the currently running mpd session\n"); - ERROR - (" --create-db force (re)creation of database and exit\n"); - ERROR - (" --no-create-db don't create database, even if it doesn't exist\n"); - ERROR(" --no-daemon don't detach from console\n"); - ERROR(" --stdout print messages to stdout and stderr\n"); - ERROR(" --verbose verbose logging\n"); - ERROR(" --version prints version information\n"); + printf("usage:\n" + " %s [options] \n" + " %s [options] (searches for ~" USER_CONFIG_FILE_LOCATION + " then " SYSTEM_CONFIG_FILE_LOCATION ")\n", + argv[0], argv[0]); + puts("\n" + "options:\n" + " --help this usage statement\n" + " --kill kill the currently running mpd session\n" + " --create-db force (re)creation of database and exit\n" + " --no-create-db don't create database, even if it doesn't exist\n" + " --no-daemon don't detach from console\n" + " --stdout print messages to stdout and stderr\n" + " --verbose verbose logging\n" + " --version prints version information\n"); } static void version(void) { - LOG(PACKAGE " (MPD: Music Player Daemon) %s\n", VERSION); - LOG("\n"); - LOG("Copyright (C) 2003-2007 Warren Dukes \n"); - LOG("Copyright (C) 2008 Max Kellermann \n"); - LOG("This is free software; see the source for copying conditions. There is NO\n"); - LOG("warranty; not even MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n"); - LOG("\n"); - LOG("Supported formats:\n"); + puts(PACKAGE " (MPD: Music Player Daemon) " VERSION " \n" + "\n" + "Copyright (C) 2003-2007 Warren Dukes \n" + "Copyright (C) 2008 Max Kellermann \n" + "This is free software; see the source for copying conditions. There is NO\n" + "warranty; not even MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n" + "\n" + "Supported formats:\n"); decoder_plugin_init_all(); decoder_plugin_print_all_suffixes(stdout); - LOG("\n"); - LOG("Supported outputs:\n"); + puts("\n" + "Supported outputs:\n"); printAllOutputPluginTypes(stdout); } -- cgit v1.2.3