mirror of
https://github.com/Sude-/lgogdownloader.git
synced 2025-02-02 05:52:31 +01:00
Exit with non-zero status when --list or --list-details fails
This commit is contained in:
parent
d8b8d6da96
commit
1388c00a4e
@ -65,7 +65,7 @@ class Downloader
|
|||||||
virtual ~Downloader();
|
virtual ~Downloader();
|
||||||
int init();
|
int init();
|
||||||
int login();
|
int login();
|
||||||
void listGames();
|
int listGames();
|
||||||
void updateCheck();
|
void updateCheck();
|
||||||
void repair();
|
void repair();
|
||||||
void download();
|
void download();
|
||||||
|
2
main.cpp
2
main.cpp
@ -571,7 +571,7 @@ int main(int argc, char *argv[])
|
|||||||
else if (config.bDownload) // Download games
|
else if (config.bDownload) // Download games
|
||||||
downloader.download();
|
downloader.download();
|
||||||
else if (config.bListDetails || config.bList) // Detailed list of games/extras
|
else if (config.bListDetails || config.bList) // Detailed list of games/extras
|
||||||
downloader.listGames();
|
res = downloader.listGames();
|
||||||
else if (!config.sOrphanRegex.empty()) // Check for orphaned files if regex for orphans is set
|
else if (!config.sOrphanRegex.empty()) // Check for orphaned files if regex for orphans is set
|
||||||
downloader.checkOrphans();
|
downloader.checkOrphans();
|
||||||
else if (config.bCheckStatus)
|
else if (config.bCheckStatus)
|
||||||
|
@ -495,12 +495,15 @@ int Downloader::getGameDetails()
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Downloader::listGames()
|
int Downloader::listGames()
|
||||||
{
|
{
|
||||||
if (config.bListDetails) // Detailed list
|
if (config.bListDetails) // Detailed list
|
||||||
{
|
{
|
||||||
if (this->games.empty())
|
if (this->games.empty()) {
|
||||||
this->getGameDetails();
|
int res = this->getGameDetails();
|
||||||
|
if (res > 0)
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
for (unsigned int i = 0; i < games.size(); ++i)
|
for (unsigned int i = 0; i < games.size(); ++i)
|
||||||
{
|
{
|
||||||
@ -696,6 +699,7 @@ void Downloader::listGames()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Downloader::repair()
|
void Downloader::repair()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user