save files with comment

This commit is contained in:
2025-01-09 15:22:10 +01:00
parent 7bfb7f5a3b
commit 8f822c5383
17 changed files with 441 additions and 54 deletions

View File

@@ -95,7 +95,13 @@ CommandLineParser::CommandLineParser()
QCommandLineOption(
QStringList() << "D" << "read-dc-version",
QCoreApplication::translate("main", "Show version of device controller."),
QCoreApplication::translate("main", "Show version of device controller."))) {
QCoreApplication::translate("main", "Show version of device controller.")))
, m_setPPid(
QCommandLineOption(
QStringList() << "P" << "set-ppid",
QCoreApplication::translate("main", "Set pid of parent process."),
QCoreApplication::translate("main", "Set pid of parent process."))) {
configure();
}
@@ -154,6 +160,9 @@ void CommandLineParser::configure() {
m_readDCVersionOption.setDefaultValue("false");
m_parser.addOption(m_readDCVersionOption);
m_setPPid.setDefaultValue("-1");
m_parser.addOption(m_setPPid);
}
void CommandLineParser::readSettings() {
@@ -286,6 +295,19 @@ QString CommandLineParser::workingDir() {
return m_workingDir;
}
qint64 CommandLineParser::ppid() {
m_ppid = -1;
if (m_parser.isSet(m_setPPid)) {
QString p = m_parser.value(m_setPPid);
bool ok;
qint64 q = p.toLongLong(&ok);
if (ok) {
m_ppid = q;
}
}
return m_ppid;
}
bool CommandLineParser::dryRun() {
if (m_parser.isSet(m_dryRunOption)) {
m_dryRun = m_parser.value(m_dryRunOption);