Commit 457ab8b2 authored by Max Kellermann's avatar Max Kellermann

CommandLine: use printf() instead of puts()

parent 1ebf5f3b
...@@ -98,7 +98,7 @@ static constexpr Domain cmdline_domain("cmdline"); ...@@ -98,7 +98,7 @@ 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
...@@ -110,28 +110,28 @@ static void version(void) ...@@ -110,28 +110,28 @@ static void version(void)
"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) ...@@ -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) ...@@ -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) ...@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment