diff options
author | Max Kellermann <max@duempel.org> | 2012-06-12 23:22:03 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2012-06-12 23:22:03 +0200 |
commit | 4eb57e1e9a1718ce93eced6bd4fb06d8abb26477 (patch) | |
tree | 2355c6d77273cf614822f5a144005ab1d353863b /src/cmdline.c | |
parent | d662c4c0cc089a6a493a7463e440f0f7e7959b48 (diff) | |
parent | 1d52e2cc7727d93e65d557c322b5dd7dc149651c (diff) | |
download | mpd-4eb57e1e9a1718ce93eced6bd4fb06d8abb26477.tar.gz mpd-4eb57e1e9a1718ce93eced6bd4fb06d8abb26477.tar.xz mpd-4eb57e1e9a1718ce93eced6bd4fb06d8abb26477.zip |
Merge branch 'v0.16.x'
Conflicts:
src/cmdline.c
src/decoder/wildmidi_decoder_plugin.c
src/gcc.h
src/glib_compat.h
src/input_stream.c
src/output_list.c
src/output_thread.c
valgrind.suppressions
Diffstat (limited to 'src/cmdline.c')
-rw-r--r-- | src/cmdline.c | 81 |
1 files changed, 50 insertions, 31 deletions
diff --git a/src/cmdline.c b/src/cmdline.c index 8ab317730..a972daf95 100644 --- a/src/cmdline.c +++ b/src/cmdline.c @@ -25,15 +25,23 @@ #include "decoder_list.h" #include "decoder_plugin.h" #include "output_list.h" +#include "output_plugin.h" +#include "input_registry.h" +#include "input_plugin.h" +#include "playlist_list.h" +#include "playlist_plugin.h" #include "ls.h" #include "mpd_error.h" +#include "glib_compat.h" #ifdef ENABLE_ENCODER #include "encoder_list.h" +#include "encoder_plugin.h" #endif #ifdef ENABLE_ARCHIVE #include "archive_list.h" +#include "archive_plugin.h" #endif #include <glib.h> @@ -54,59 +62,70 @@ cmdline_quark(void) return g_quark_from_static_string("cmdline"); } -static void -print_all_decoders(FILE *fp) -{ - for (unsigned i = 0; decoder_plugins[i] != NULL; ++i) { - const struct decoder_plugin *plugin = decoder_plugins[i]; - const char *const*suffixes; - - fprintf(fp, "[%s]", plugin->name); - - for (suffixes = plugin->suffixes; - suffixes != NULL && *suffixes != NULL; - ++suffixes) { - fprintf(fp, " %s", *suffixes); - } - - fprintf(fp, "\n"); - } -} - G_GNUC_NORETURN static void version(void) { puts(PACKAGE " (MPD: Music Player Daemon) " VERSION " \n" "\n" "Copyright (C) 2003-2007 Warren Dukes <warren.dukes@gmail.com>\n" - "Copyright (C) 2008-2011 Max Kellermann <max@duempel.org>\n" + "Copyright (C) 2008-2012 Max Kellermann <max@duempel.org>\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 decoders:\n"); + "Decoders plugins:"); + + decoder_plugins_for_each(plugin) { + printf(" [%s]", plugin->name); - print_all_decoders(stdout); + const char *const*suffixes = plugin->suffixes; + if (suffixes != NULL) + for (; *suffixes != NULL; ++suffixes) + printf(" %s", *suffixes); + + puts(""); + } puts("\n" - "Supported outputs:\n"); - audio_output_plugin_print_all_types(stdout); + "Output plugins:"); + audio_output_plugins_for_each(plugin) + printf(" %s", plugin->name); + puts(""); #ifdef ENABLE_ENCODER puts("\n" - "Supported encoders:\n"); - encoder_plugin_print_all_types(stdout); + "Encoder plugins:"); + encoder_plugins_for_each(plugin) + printf(" %s", plugin->name); + puts(""); #endif - #ifdef ENABLE_ARCHIVE puts("\n" - "Supported archives:\n"); - archive_plugin_init_all(); - archive_plugin_print_all_suffixes(stdout); + "Archive plugins:"); + archive_plugins_for_each(plugin) { + printf(" [%s]", plugin->name); + + const char *const*suffixes = plugin->suffixes; + if (suffixes != NULL) + for (; *suffixes != NULL; ++suffixes) + printf(" %s", *suffixes); + + puts(""); + } #endif puts("\n" - "Supported protocols:\n"); + "Input plugins:"); + input_plugins_for_each(plugin) + printf(" %s", plugin->name); + + puts("\n\n" + "Playlist plugins:"); + playlist_plugins_for_each(plugin) + printf(" %s", plugin->name); + + puts("\n\n" + "Protocols:"); print_supported_uri_schemes_to_fp(stdout); exit(EXIT_SUCCESS); |