Add parsing for alwaysDownloadConfig and alwaysDownloadDC.

This commit is contained in:
Gerhard Hoffmann 2023-11-21 09:49:47 +01:00
parent 5ee1308c9d
commit c15cebf503

View File

@ -45,6 +45,14 @@ CommandLineParser::CommandLineParser()
QCommandLineOption(
"no-psa-hardware-update",
QCoreApplication::translate("main", "Do not update the PSA firmware (json, device-controller).")))
, m_alwaysDownloadConfigOption(
QCommandLineOption(
"always-download-config",
QCoreApplication::translate("main", "Always download the (json-)configs to DC).")))
, m_alwaysDownloadDCOption(
QCommandLineOption(
"always-download-dc",
QCoreApplication::translate("main", "Always download the dc-bin-file to DC).")))
, m_workingDirectoryOption(
QCommandLineOption(
QStringList() << "working-directory" << "working-directory",
@ -129,6 +137,12 @@ void CommandLineParser::readSettings() {
if (key.contains("no-psa-hardware-update")) {
m_noUpdatePsaHardware = (v.toBool() ? "true" : "false");
} else
if (key.contains("always-download-config")) {
m_alwaysDownloadConfig = (v.toBool() ? "true" : "false");
} else
if (key.contains("always-download-dc")) {
m_alwaysDownloadDC = (v.toBool() ? "true" : "false");
} else
if (key.contains("yocto-install")) {
m_showYoctoInstallStatus = (v.toBool() ? "true" : "false");
} else
@ -205,3 +219,17 @@ bool CommandLineParser::extendedVersion() {
}
return m_showExtendedVersion == "false" ? false : true;
}
bool CommandLineParser::alwaysDownloadConfig() {
if (m_parser.isSet(m_alwaysDownloadConfigOption)) {
m_alwaysDownloadConfig = m_parser.value(m_alwaysDownloadConfigOption);
}
return m_alwaysDownloadConfig == "false" ? false : true;
}
bool CommandLineParser::alwaysDownloadDC() {
if (m_parser.isSet(m_alwaysDownloadDCOption)) {
m_alwaysDownloadDC = m_parser.value(m_alwaysDownloadDCOption);
}
return m_alwaysDownloadDC == "false" ? false : true;
}