main: print usage to stdout

Using the logging library here is inappropriate.
This commit is contained in:
Max Kellermann 2008-11-05 20:52:14 +01:00
parent 130fa94423
commit 7f880ab8ba

View File

@ -111,40 +111,39 @@ static int setenv(const char *name, const char *value, int replace)
static void usage(char *argv[]) static void usage(char *argv[])
{ {
ERROR("usage:\n"); printf("usage:\n"
ERROR(" %s [options] <conf file>\n", argv[0]); " %s [options] <conf file>\n"
ERROR(" %s [options] (searches for ~%s then %s)\n", " %s [options] (searches for ~" USER_CONFIG_FILE_LOCATION
argv[0], USER_CONFIG_FILE_LOCATION, SYSTEM_CONFIG_FILE_LOCATION); " then " SYSTEM_CONFIG_FILE_LOCATION ")\n",
ERROR("\n"); argv[0], argv[0]);
ERROR("options:\n"); puts("\n"
ERROR(" --help this usage statement\n"); "options:\n"
ERROR(" --kill kill the currently running mpd session\n"); " --help this usage statement\n"
ERROR " --kill kill the currently running mpd session\n"
(" --create-db force (re)creation of database and exit\n"); " --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"
(" --no-create-db don't create database, even if it doesn't exist\n"); " --no-daemon don't detach from console\n"
ERROR(" --no-daemon don't detach from console\n"); " --stdout print messages to stdout and stderr\n"
ERROR(" --stdout print messages to stdout and stderr\n"); " --verbose verbose logging\n"
ERROR(" --verbose verbose logging\n"); " --version prints version information\n");
ERROR(" --version prints version information\n");
} }
static void version(void) static void version(void)
{ {
LOG(PACKAGE " (MPD: Music Player Daemon) %s\n", VERSION); puts(PACKAGE " (MPD: Music Player Daemon) " VERSION " \n"
LOG("\n"); "\n"
LOG("Copyright (C) 2003-2007 Warren Dukes <warren.dukes@gmail.com>\n"); "Copyright (C) 2003-2007 Warren Dukes <warren.dukes@gmail.com>\n"
LOG("Copyright (C) 2008 Max Kellermann <max@duempel.org>\n"); "Copyright (C) 2008 Max Kellermann <max@duempel.org>\n"
LOG("This is free software; see the source for copying conditions. There is NO\n"); "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"); "warranty; not even MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n"
LOG("\n"); "\n"
LOG("Supported formats:\n"); "Supported formats:\n");
decoder_plugin_init_all(); decoder_plugin_init_all();
decoder_plugin_print_all_suffixes(stdout); decoder_plugin_print_all_suffixes(stdout);
LOG("\n"); puts("\n"
LOG("Supported outputs:\n"); "Supported outputs:\n");
printAllOutputPluginTypes(stdout); printAllOutputPluginTypes(stdout);
} }