From 6751205ff30f87b35a6293849c10234970fd1ecd Mon Sep 17 00:00:00 2001 From: Sude Date: Mon, 17 Nov 2014 16:28:43 +0200 Subject: [PATCH] Fix regex alias "all" for cached details --- main.cpp | 2 +- src/downloader.cpp | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/main.cpp b/main.cpp index d32fe9e..8babaf0 100644 --- a/main.cpp +++ b/main.cpp @@ -138,7 +138,7 @@ int main(int argc, char *argv[]) ("list-details", bpo::value(&config.bListDetails)->zero_tokens()->default_value(false), "List games with detailed info") ("download", bpo::value(&config.bDownload)->zero_tokens()->default_value(false), "Download") ("repair", bpo::value(&config.bRepair)->zero_tokens()->default_value(false), "Repair downloaded files\nUse --repair --download to redownload files when filesizes don't match (possibly different version). Redownload will rename the old file (appends .old to filename)") - ("game", bpo::value(&config.sGameRegex)->default_value(""), "Set regular expression filter\nfor download/list/repair (Perl syntax)\nAliases: \"all\", \"free\"") + ("game", bpo::value(&config.sGameRegex)->default_value(""), "Set regular expression filter\nfor download/list/repair (Perl syntax)\nAliases: \"all\", \"free\"\nAlias \"free\" doesn't work with cached details") ("create-xml", bpo::value(&config.sXMLFile)->default_value(""), "Create GOG XML for file\n\"automatic\" to enable automatic XML creation") ("update-check", bpo::value(&config.bUpdateCheck)->zero_tokens()->default_value(false), "Check for update notifications") ("check-orphans", bpo::value(&config.sOrphanRegex)->implicit_value(""), check_orphans_text.c_str()) diff --git a/src/downloader.cpp b/src/downloader.cpp index e209260..c0fea20 100644 --- a/src/downloader.cpp +++ b/src/downloader.cpp @@ -211,6 +211,12 @@ int Downloader::getGameDetails() { if (config.bUseCache && !config.bUpdateCache) { + // GameRegex filter alias for all games + if (config.sGameRegex == "all") + config.sGameRegex = ".*"; + else if (config.sGameRegex == "free") + std::cout << "Warning: regex alias \"free\" doesn't work with cached details" << std::endl; + int result = this->loadGameDetailsCache(); if (result == 0) {