mirror of
https://github.com/Sude-/lgogdownloader.git
synced 2024-11-20 11:49:17 +01:00
Change --report option to allow setting the filename of report
This commit is contained in:
parent
4dc8f937f2
commit
7a15a93676
@ -53,6 +53,7 @@ class Config
|
||||
std::string sBlacklistFilePath;
|
||||
std::string sOrphanRegex;
|
||||
std::string sCoverList;
|
||||
std::string sReportFilePath;
|
||||
unsigned int iInstallerType;
|
||||
unsigned int iInstallerLanguage;
|
||||
int iRetries;
|
||||
|
6
main.cpp
6
main.cpp
@ -82,6 +82,7 @@ int main(int argc, char *argv[])
|
||||
bool bNoDeb = false;
|
||||
bool bNoTarGz = false;
|
||||
bool bNoCover = false;
|
||||
config.bReport = false;
|
||||
// Commandline options (no config file)
|
||||
options_cli_no_cfg.add_options()
|
||||
("help,h", "Print help message")
|
||||
@ -98,7 +99,7 @@ int main(int argc, char *argv[])
|
||||
("status", bpo::value<bool>(&config.bCheckStatus)->zero_tokens()->default_value(false), "Show status of files\n\nOutput format:\nstatuscode gamename filename filesize filehash\n\nStatus codes:\nOK - File is OK\nND - File is not downloaded\nMD5 - MD5 mismatch, different version")
|
||||
("save-config", bpo::value<bool>(&config.bSaveConfig)->zero_tokens()->default_value(false), "Create config file with current settings")
|
||||
("reset-config", bpo::value<bool>(&config.bResetConfig)->zero_tokens()->default_value(false), "Reset config settings to default")
|
||||
("report", bpo::value<bool>(&config.bReport)->zero_tokens()->default_value(false), "Save report of downloaded/repaired files")
|
||||
("report", bpo::value<std::string>(&config.sReportFilePath)->implicit_value("lgogdownloader-report.log"), "Save report of downloaded/repaired files to specified file\nDefault filename: lgogdownloader-report.log")
|
||||
("no-cover", bpo::value<bool>(&bNoCover)->zero_tokens()->default_value(false), "Don't download cover images. Overrides --cover option.\nUseful for making exceptions when \"cover\" is set to true in config file.")
|
||||
;
|
||||
// Commandline options (config file)
|
||||
@ -254,6 +255,9 @@ int main(int argc, char *argv[])
|
||||
if (config.sOrphanRegex.empty())
|
||||
config.sOrphanRegex = orphans_regex_default;
|
||||
|
||||
if (vm.count("report"))
|
||||
config.bReport = true;
|
||||
|
||||
if (config.iWait > 0)
|
||||
config.iWait *= 1000;
|
||||
|
||||
|
@ -91,10 +91,10 @@ int Downloader::init()
|
||||
|
||||
if (config.bReport && (config.bDownload || config.bRepair))
|
||||
{
|
||||
this->report_ofs.open("lgogdownloader-report.log");
|
||||
this->report_ofs.open(config.sReportFilePath);
|
||||
if (!this->report_ofs)
|
||||
{
|
||||
std::cout << "Failed to create lgogdownloader-report.log" << std::endl;
|
||||
std::cout << "Failed to create " << config.sReportFilePath << std::endl;
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user