mirror of
https://github.com/Sude-/lgogdownloader.git
synced 2025-02-01 21:42:31 +01:00
Combine --list and --list-format options
Removes --list-format added in c9198d672da26fac0c567abcd6fac9e901ad38c8 --list is used to select the format instead
This commit is contained in:
parent
9e49b6fa20
commit
9d188e73bd
@ -239,7 +239,6 @@ class Config
|
||||
bool bDownload;
|
||||
bool bRepair;
|
||||
bool bUpdated;
|
||||
bool bList;
|
||||
bool bCheckStatus;
|
||||
bool bShowWishlist;
|
||||
bool bNotifications;
|
||||
|
13
main.cpp
13
main.cpp
@ -162,7 +162,7 @@ int main(int argc, char *argv[])
|
||||
include_options_text += "Separate with \",\" to use multiple values";
|
||||
|
||||
// Create help text for --list-format option
|
||||
std::string list_format_text = "Select output format\n";
|
||||
std::string list_format_text = "List games\nPossible output formats:\n";
|
||||
for (unsigned int i = 0; i < GlobalConstants::LIST_FORMAT.size(); ++i)
|
||||
{
|
||||
list_format_text += GlobalConstants::LIST_FORMAT[i].str + " = " + GlobalConstants::LIST_FORMAT[i].regexp + "\n";
|
||||
@ -190,6 +190,7 @@ int main(int argc, char *argv[])
|
||||
bpo::options_description options_cfg_only;
|
||||
bpo::options_description options_cfg_all("Configuration");
|
||||
bool bClearUpdateNotifications = false;
|
||||
bool bList = false;
|
||||
try
|
||||
{
|
||||
bool bInsecure = false;
|
||||
@ -216,8 +217,7 @@ int main(int argc, char *argv[])
|
||||
("help,h", "Print help message")
|
||||
("version", "Print version information")
|
||||
("login", bpo::value<bool>(&Globals::globalConfig.bLogin)->zero_tokens()->default_value(false), "Login")
|
||||
("list", bpo::value<bool>(&Globals::globalConfig.bList)->zero_tokens()->default_value(false), "List games")
|
||||
("list-format", bpo::value<std::string>(&sListFormat)->default_value("no_details"), list_format_text.c_str())
|
||||
("list", bpo::value<std::string>(&sListFormat)->implicit_value("no_details"), list_format_text.c_str())
|
||||
("download", bpo::value<bool>(&Globals::globalConfig.bDownload)->zero_tokens()->default_value(false), "Download")
|
||||
("repair", bpo::value<bool>(&Globals::globalConfig.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<std::string>(&Globals::globalConfig.sGameRegex)->default_value(""), "Set regular expression filter\nfor download/list/repair (Perl syntax)")
|
||||
@ -337,6 +337,11 @@ int main(int argc, char *argv[])
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (vm.count("list"))
|
||||
{
|
||||
bList = true;
|
||||
}
|
||||
|
||||
// Create lgogdownloader directories
|
||||
boost::filesystem::path path = Globals::globalConfig.sXMLDirectory;
|
||||
if (!boost::filesystem::exists(path))
|
||||
@ -790,7 +795,7 @@ int main(int argc, char *argv[])
|
||||
downloader.repair();
|
||||
else if (Globals::globalConfig.bDownload) // Download games
|
||||
downloader.download();
|
||||
else if (Globals::globalConfig.bList) // List games/extras
|
||||
else if (bList) // List games/extras
|
||||
res = downloader.listGames();
|
||||
else if (Globals::globalConfig.bListTags) // List tags
|
||||
res = downloader.listTags();
|
||||
|
Loading…
x
Reference in New Issue
Block a user