test/DumpDatabase: add "URI" parameter
This commit is contained in:
parent
7c13666226
commit
4eefc2e47c
|
@ -83,13 +83,15 @@ DumpPlaylist(const PlaylistInfo &playlist, const LightDirectory &directory)
|
||||||
int
|
int
|
||||||
main(int argc, char **argv)
|
main(int argc, char **argv)
|
||||||
try {
|
try {
|
||||||
if (argc != 2) {
|
if (argc < 2 || argc > 3) {
|
||||||
fmt::print(stderr, "Usage: DumpDatabase CONFIG\n");
|
fmt::print(stderr, "Usage: DumpDatabase CONFIG [URI]\n");
|
||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
const FromNarrowPath config_path = argv[1];
|
const FromNarrowPath config_path = argv[1];
|
||||||
|
|
||||||
|
const char *uri = argc >= 3 ? argv[2] : "";
|
||||||
|
|
||||||
/* initialize MPD */
|
/* initialize MPD */
|
||||||
|
|
||||||
GlobalInit init;
|
GlobalInit init;
|
||||||
|
@ -111,7 +113,7 @@ try {
|
||||||
|
|
||||||
AtScopeExit(&db) { db->Close(); };
|
AtScopeExit(&db) { db->Close(); };
|
||||||
|
|
||||||
const DatabaseSelection selection("", true);
|
const DatabaseSelection selection(uri, true);
|
||||||
|
|
||||||
db->Visit(selection, DumpDirectory, DumpSong, DumpPlaylist);
|
db->Visit(selection, DumpDirectory, DumpSong, DumpPlaylist);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue