diff options
author | Max Kellermann <max@duempel.org> | 2009-10-13 16:20:21 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2009-10-13 16:20:21 +0200 |
commit | eea4edd92cd1cf32537e8870f90d7543af62cdc9 (patch) | |
tree | fbcb14a7f32002d7b903bc13463fd8c9f8ebb6bd /test | |
parent | cb331ae436700efcfc81a15e6f98ae89c34392e0 (diff) | |
download | mpd-eea4edd92cd1cf32537e8870f90d7543af62cdc9.tar.gz mpd-eea4edd92cd1cf32537e8870f90d7543af62cdc9.tar.xz mpd-eea4edd92cd1cf32537e8870f90d7543af62cdc9.zip |
test/dump_playlist: parse a configuration file
Diffstat (limited to '')
-rw-r--r-- | test/dump_playlist.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/test/dump_playlist.c b/test/dump_playlist.c index 3134d95b1..f789a2820 100644 --- a/test/dump_playlist.c +++ b/test/dump_playlist.c @@ -44,15 +44,16 @@ int main(int argc, char **argv) const char *uri; struct input_stream is; bool success; + GError *error = NULL; struct playlist_provider *playlist; struct song *song; - if (argc != 2) { - g_printerr("Usage: dump_playlist URI\n"); + if (argc != 3) { + g_printerr("Usage: dump_playlist CONFIG URI\n"); return 1; } - uri = argv[1]; + uri = argv[2]; /* initialize GLib */ @@ -63,6 +64,13 @@ int main(int argc, char **argv) tag_pool_init(); config_global_init(); + success = config_read_file(argv[1], &error); + if (!success) { + g_printerr("%s:", error->message); + g_error_free(error); + return 1; + } + input_stream_global_init(); playlist_list_global_init(); |