Skip to content

Commit

Permalink
Added downloadPackageArchive CLI command
Browse files Browse the repository at this point in the history
  • Loading branch information
vedderb committed Mar 22, 2024
1 parent 1073335 commit 481921a
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ static void showHelp()
qDebug() << "--packLisp [fileIn:fileOut] : Pack lisp-file and the included imports.";
qDebug() << "--bridgeAppData : Send app data (such as data from send-data in lisp) to stdout.";
qDebug() << "--offscreen : Use offscreen QPA so that X is not required for the CLI-mode.";
qDebug() << "--downloadPackageArchive : Download package archive to application data directory.";
}

#ifdef Q_OS_LINUX
Expand Down Expand Up @@ -312,6 +313,7 @@ int main(int argc, char *argv[])
QString lispPackOut = "";
bool bridgeAppData = false;
bool offscreen = false;
bool downloadPackageArchive = false;

// Arguments can be hard-coded in a build like this:
// qmlWindowSize = QSize(400, 800);
Expand Down Expand Up @@ -677,6 +679,11 @@ int main(int argc, char *argv[])
found = true;
}

if (str == "--downloadPackageArchive") {
downloadPackageArchive = true;
found = true;
}

if (!found) {
if (dash) {
qCritical() << "At least one of the flags is invalid:" << str;
Expand All @@ -689,6 +696,14 @@ int main(int argc, char *argv[])
}
}

if (downloadPackageArchive) {
QCoreApplication appTmp(argc, argv);
CodeLoader loader;
qDebug() << "Downloading package archive...";
loader.downloadPackageArchive();
qDebug() << "Package archive downloaded!";
}

if (!xmlCodePath.isEmpty()) {
ConfigParams conf;
if (!conf.loadParamsXml(xmlCodePath)) {
Expand Down Expand Up @@ -1521,6 +1536,8 @@ int main(int argc, char *argv[])
} else if (useBoardSetupWindow){
bw = new BoardSetupWindow;
bw->show();
} else if (downloadPackageArchive) {
return 0;
} else {
QPixmapCache::setCacheLimit(256000);
w = new MainWindow;
Expand Down

0 comments on commit 481921a

Please sign in to comment.