cmdline: Print available protocols when --version is run.
This commit is contained in:
parent
0f64e658fd
commit
e7f034dcef
1
NEWS
1
NEWS
|
@ -49,6 +49,7 @@ ver 0.15 - (200?/??/??)
|
||||||
* daemon: ignore "user" setting if already running as that user
|
* daemon: ignore "user" setting if already running as that user
|
||||||
* listen: fix broken client IP addresses in log
|
* listen: fix broken client IP addresses in log
|
||||||
* 32 bit audio support
|
* 32 bit audio support
|
||||||
|
* Print available protocols in --version
|
||||||
|
|
||||||
|
|
||||||
ver 0.14.2 (2009/02/13)
|
ver 0.14.2 (2009/02/13)
|
||||||
|
|
|
@ -23,6 +23,7 @@
|
||||||
#include "decoder_list.h"
|
#include "decoder_list.h"
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#include "audioOutput.h"
|
#include "audioOutput.h"
|
||||||
|
#include "ls.h"
|
||||||
|
|
||||||
#ifdef ENABLE_ARCHIVE
|
#ifdef ENABLE_ARCHIVE
|
||||||
#include "archive_list.h"
|
#include "archive_list.h"
|
||||||
|
@ -63,6 +64,10 @@ static void version(void)
|
||||||
archive_plugin_print_all_suffixes(stdout);
|
archive_plugin_print_all_suffixes(stdout);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
puts("\n"
|
||||||
|
"Supported protocols:\n");
|
||||||
|
print_supported_uri_schemes_to_fp(stdout);
|
||||||
|
|
||||||
exit(EXIT_SUCCESS);
|
exit(EXIT_SUCCESS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
20
src/ls.c
20
src/ls.c
|
@ -24,6 +24,12 @@
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* file:// is not included in remoteUrlPrefixes, the connection method
|
||||||
|
* is detected at runtime and displayed as a urlhandler if the client is
|
||||||
|
* connected by IPC socket.
|
||||||
|
*/
|
||||||
static const char *remoteUrlPrefixes[] = {
|
static const char *remoteUrlPrefixes[] = {
|
||||||
#ifdef HAVE_CURL
|
#ifdef HAVE_CURL
|
||||||
"http://",
|
"http://",
|
||||||
|
@ -40,6 +46,20 @@ static const char *remoteUrlPrefixes[] = {
|
||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
|
|
||||||
|
void print_supported_uri_schemes_to_fp(FILE *fp)
|
||||||
|
{
|
||||||
|
const char **prefixes = remoteUrlPrefixes;
|
||||||
|
|
||||||
|
#ifdef HAVE_UN
|
||||||
|
fprintf(fp, "file:// ");
|
||||||
|
#endif
|
||||||
|
while (*prefixes) {
|
||||||
|
fprintf(fp, "%s ", *prefixes);
|
||||||
|
prefixes++;
|
||||||
|
}
|
||||||
|
puts("\n");
|
||||||
|
}
|
||||||
|
|
||||||
void print_supported_uri_schemes(struct client *client)
|
void print_supported_uri_schemes(struct client *client)
|
||||||
{
|
{
|
||||||
const char **prefixes = remoteUrlPrefixes;
|
const char **prefixes = remoteUrlPrefixes;
|
||||||
|
|
6
src/ls.h
6
src/ls.h
|
@ -20,6 +20,7 @@
|
||||||
#define MPD_LS_H
|
#define MPD_LS_H
|
||||||
|
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
struct client;
|
struct client;
|
||||||
|
|
||||||
|
@ -36,4 +37,9 @@ bool uri_supported_scheme(const char *url);
|
||||||
*/
|
*/
|
||||||
void print_supported_uri_schemes(struct client *client);
|
void print_supported_uri_schemes(struct client *client);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Send a list of supported URI schemes to a file pointer.
|
||||||
|
*/
|
||||||
|
void print_supported_uri_schemes_to_fp(FILE *fp);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue