From eea4edd92cd1cf32537e8870f90d7543af62cdc9 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 13 Oct 2009 16:20:21 +0200 Subject: [PATCH] test/dump_playlist: parse a configuration file --- test/dump_playlist.c | 14 +++++++++++--- 1 file 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();