Removed 't (testMode)' and 'e (executeScript)' options. Adapted call to Worker-ctor.
This commit is contained in:
parent
9775792916
commit
60084450e6
35
main.cpp
35
main.cpp
@ -84,16 +84,6 @@ int main(int argc, char *argv[]) {
|
|||||||
QCoreApplication::translate("main", "Maintenance mode for underlying script"));
|
QCoreApplication::translate("main", "Maintenance mode for underlying script"));
|
||||||
parser.addOption(maintenanceOption);
|
parser.addOption(maintenanceOption);
|
||||||
|
|
||||||
// test-mode: edit the file update_log.csv and execute the commands
|
|
||||||
// contained in it. Do not call the update-script.
|
|
||||||
QCommandLineOption testOption(QStringList() << "t" << "test",
|
|
||||||
QCoreApplication::translate("main", "Test mode for ATBUpdateTool"));
|
|
||||||
parser.addOption(testOption);
|
|
||||||
|
|
||||||
QCommandLineOption execScriptOption(QStringList() << "e" << "execute-script-only",
|
|
||||||
QCoreApplication::translate("main", "ATBUpdateTool executes update-script only. No download of any files."));
|
|
||||||
parser.addOption(execScriptOption);
|
|
||||||
|
|
||||||
QCommandLineOption dryRunOption(QStringList() << "d" << "dry-run",
|
QCommandLineOption dryRunOption(QStringList() << "d" << "dry-run",
|
||||||
QCoreApplication::translate("main", "Start ATBUpdateTool in dry-run-mode. No actual actions."));
|
QCoreApplication::translate("main", "Start ATBUpdateTool in dry-run-mode. No actual actions."));
|
||||||
parser.addOption(dryRunOption);
|
parser.addOption(dryRunOption);
|
||||||
@ -112,8 +102,6 @@ int main(int argc, char *argv[]) {
|
|||||||
QString plugInName = parser.value(pluginNameOption);
|
QString plugInName = parser.value(pluginNameOption);
|
||||||
QString workingDir = parser.value(workingDirectoryOption);
|
QString workingDir = parser.value(workingDirectoryOption);
|
||||||
bool maintenanceMode = parser.isSet(maintenanceOption);
|
bool maintenanceMode = parser.isSet(maintenanceOption);
|
||||||
bool testMode = parser.isSet(testOption);
|
|
||||||
bool executeScriptOnly = parser.isSet(execScriptOption);
|
|
||||||
bool dryRun = parser.isSet(dryRunOption);
|
bool dryRun = parser.isSet(dryRunOption);
|
||||||
QString const rtPath = QCoreApplication::applicationDirPath();
|
QString const rtPath = QCoreApplication::applicationDirPath();
|
||||||
|
|
||||||
@ -131,8 +119,6 @@ int main(int argc, char *argv[]) {
|
|||||||
qInfo() << "plugInName ........" << plugInName;
|
qInfo() << "plugInName ........" << plugInName;
|
||||||
qInfo() << "workingDir ........" << workingDir;
|
qInfo() << "workingDir ........" << workingDir;
|
||||||
qInfo() << "maintenanceMode ..." << maintenanceMode;
|
qInfo() << "maintenanceMode ..." << maintenanceMode;
|
||||||
qInfo() << "testMode .........." << testMode;
|
|
||||||
qInfo() << "execScriptOnly ...." << executeScriptOnly;
|
|
||||||
qInfo() << "dryRun ............" << dryRun;
|
qInfo() << "dryRun ............" << dryRun;
|
||||||
|
|
||||||
// before loading the library, delete all possible shared memory segments
|
// before loading the library, delete all possible shared memory segments
|
||||||
@ -146,15 +132,22 @@ int main(int argc, char *argv[]) {
|
|||||||
// hw->dc_autoRequest(false);
|
// hw->dc_autoRequest(false);
|
||||||
|
|
||||||
QString const update_ctrl_file = "/opt/app/tools/atbupdate/update_log.csv";
|
QString const update_ctrl_file = "/opt/app/tools/atbupdate/update_log.csv";
|
||||||
Worker worker(hw, update_ctrl_file,
|
|
||||||
"https://git.mimbach49.de/GerhardHoffmann/customer_999.git",
|
int machineNr = Worker::read1stLineOfFile("/etc/machine_nr");
|
||||||
"customer_999",
|
int customerNr = Worker::read1stLineOfFile("/etc/cust_nr");
|
||||||
"zg1/zone1",
|
QString customerNrStr = QString("customer_") + QString::number(customerNr).rightJustified(3, '0');
|
||||||
|
int zoneNr = Worker::read1stLineOfFile("/etc/zone_nr");
|
||||||
|
QString branchName = QString("zg1/zone%1").arg(zoneNr);
|
||||||
|
|
||||||
|
Worker worker(hw,
|
||||||
|
customerNr,
|
||||||
|
machineNr,
|
||||||
|
zoneNr,
|
||||||
|
branchName,
|
||||||
workingDir,
|
workingDir,
|
||||||
maintenanceMode,
|
maintenanceMode,
|
||||||
testMode,
|
dryRun
|
||||||
executeScriptOnly,
|
);
|
||||||
dryRun);
|
|
||||||
|
|
||||||
return a.exec();
|
return a.exec();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user