CommandLine: use printf() instead of puts()
This commit is contained in:
parent
1ebf5f3bcb
commit
457ab8b2ce
@ -98,40 +98,40 @@ static constexpr Domain cmdline_domain("cmdline");
|
|||||||
gcc_noreturn
|
gcc_noreturn
|
||||||
static void version(void)
|
static void version(void)
|
||||||
{
|
{
|
||||||
puts("Music Player Daemon " VERSION
|
printf("Music Player Daemon " VERSION
|
||||||
#ifdef GIT_COMMIT
|
#ifdef GIT_COMMIT
|
||||||
" (" GIT_COMMIT ")"
|
" (" GIT_COMMIT ")"
|
||||||
#endif
|
#endif
|
||||||
"\n"
|
"\n"
|
||||||
"\n"
|
"\n"
|
||||||
"Copyright (C) 2003-2007 Warren Dukes <warren.dukes@gmail.com>\n"
|
"Copyright (C) 2003-2007 Warren Dukes <warren.dukes@gmail.com>\n"
|
||||||
"Copyright (C) 2008-2014 Max Kellermann <max@duempel.org>\n"
|
"Copyright (C) 2008-2014 Max Kellermann <max@duempel.org>\n"
|
||||||
"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"
|
||||||
"warranty; not even MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n");
|
"warranty; not even MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n");
|
||||||
|
|
||||||
#ifdef ENABLE_DATABASE
|
#ifdef ENABLE_DATABASE
|
||||||
puts("\n"
|
printf("\n"
|
||||||
"Database plugins:");
|
"Database plugins:\n");
|
||||||
|
|
||||||
for (auto i = database_plugins; *i != nullptr; ++i)
|
for (auto i = database_plugins; *i != nullptr; ++i)
|
||||||
printf(" %s", (*i)->name);
|
printf(" %s", (*i)->name);
|
||||||
|
|
||||||
puts("\n\n"
|
printf("\n\n"
|
||||||
"Storage plugins:");
|
"Storage plugins:\n");
|
||||||
|
|
||||||
for (auto i = storage_plugins; *i != nullptr; ++i)
|
for (auto i = storage_plugins; *i != nullptr; ++i)
|
||||||
printf(" %s", (*i)->name);
|
printf(" %s", (*i)->name);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef ENABLE_NEIGHBOR_PLUGINS
|
#ifdef ENABLE_NEIGHBOR_PLUGINS
|
||||||
puts("\n\n"
|
printf("\n\n"
|
||||||
"Neighbor plugins:");
|
"Neighbor plugins:\n");
|
||||||
for (auto i = neighbor_plugins; *i != nullptr; ++i)
|
for (auto i = neighbor_plugins; *i != nullptr; ++i)
|
||||||
printf(" %s", (*i)->name);
|
printf(" %s", (*i)->name);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
puts("\n\n"
|
printf("\n\n"
|
||||||
"Decoders plugins:");
|
"Decoders plugins:\n");
|
||||||
|
|
||||||
decoder_plugins_for_each([](const DecoderPlugin &plugin){
|
decoder_plugins_for_each([](const DecoderPlugin &plugin){
|
||||||
printf(" [%s]", plugin.name);
|
printf(" [%s]", plugin.name);
|
||||||
@ -141,31 +141,31 @@ static void version(void)
|
|||||||
for (; *suffixes != nullptr; ++suffixes)
|
for (; *suffixes != nullptr; ++suffixes)
|
||||||
printf(" %s", *suffixes);
|
printf(" %s", *suffixes);
|
||||||
|
|
||||||
puts("");
|
printf("\n");
|
||||||
});
|
});
|
||||||
|
|
||||||
puts("\n"
|
printf("\n"
|
||||||
"Tag plugins:\n"
|
"Tag plugins:\n"
|
||||||
#ifdef ENABLE_ID3TAG
|
#ifdef ENABLE_ID3TAG
|
||||||
" id3tag"
|
" id3tag"
|
||||||
#endif
|
#endif
|
||||||
"\n\n"
|
"\n\n"
|
||||||
"Output plugins:");
|
"Output plugins:\n");
|
||||||
audio_output_plugins_for_each(plugin)
|
audio_output_plugins_for_each(plugin)
|
||||||
printf(" %s", plugin->name);
|
printf(" %s", plugin->name);
|
||||||
puts("");
|
printf("\n");
|
||||||
|
|
||||||
#ifdef ENABLE_ENCODER
|
#ifdef ENABLE_ENCODER
|
||||||
puts("\n"
|
printf("\n"
|
||||||
"Encoder plugins:");
|
"Encoder plugins:\n");
|
||||||
encoder_plugins_for_each(plugin)
|
encoder_plugins_for_each(plugin)
|
||||||
printf(" %s", plugin->name);
|
printf(" %s", plugin->name);
|
||||||
puts("");
|
printf("\n");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef ENABLE_ARCHIVE
|
#ifdef ENABLE_ARCHIVE
|
||||||
puts("\n"
|
printf("\n"
|
||||||
"Archive plugins:");
|
"Archive plugins:\n");
|
||||||
archive_plugins_for_each(plugin) {
|
archive_plugins_for_each(plugin) {
|
||||||
printf(" [%s]", plugin->name);
|
printf(" [%s]", plugin->name);
|
||||||
|
|
||||||
@ -174,22 +174,22 @@ static void version(void)
|
|||||||
for (; *suffixes != nullptr; ++suffixes)
|
for (; *suffixes != nullptr; ++suffixes)
|
||||||
printf(" %s", *suffixes);
|
printf(" %s", *suffixes);
|
||||||
|
|
||||||
puts("");
|
printf("\n");
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
puts("\n"
|
printf("\n"
|
||||||
"Input plugins:");
|
"Input plugins:\n");
|
||||||
input_plugins_for_each(plugin)
|
input_plugins_for_each(plugin)
|
||||||
printf(" %s", plugin->name);
|
printf(" %s", plugin->name);
|
||||||
|
|
||||||
puts("\n\n"
|
printf("\n\n"
|
||||||
"Playlist plugins:");
|
"Playlist plugins:\n");
|
||||||
playlist_plugins_for_each(plugin)
|
playlist_plugins_for_each(plugin)
|
||||||
printf(" %s", plugin->name);
|
printf(" %s", plugin->name);
|
||||||
|
|
||||||
puts("\n\n"
|
printf("\n\n"
|
||||||
"Protocols:");
|
"Protocols:\n");
|
||||||
print_supported_uri_schemes_to_fp(stdout);
|
print_supported_uri_schemes_to_fp(stdout);
|
||||||
|
|
||||||
exit(EXIT_SUCCESS);
|
exit(EXIT_SUCCESS);
|
||||||
@ -211,12 +211,12 @@ static void PrintOption(const OptionDef &opt)
|
|||||||
gcc_noreturn
|
gcc_noreturn
|
||||||
static void help(void)
|
static void help(void)
|
||||||
{
|
{
|
||||||
puts("Usage:\n"
|
printf("Usage:\n"
|
||||||
" mpd [OPTION...] [path/to/mpd.conf]\n"
|
" mpd [OPTION...] [path/to/mpd.conf]\n"
|
||||||
"\n"
|
"\n"
|
||||||
"Music Player Daemon - a daemon for playing music.\n"
|
"Music Player Daemon - a daemon for playing music.\n"
|
||||||
"\n"
|
"\n"
|
||||||
"Options:");
|
"Options:\n");
|
||||||
|
|
||||||
PrintOption(opt_help);
|
PrintOption(opt_help);
|
||||||
PrintOption(opt_kill);
|
PrintOption(opt_kill);
|
||||||
|
Loading…
Reference in New Issue
Block a user