diff --git a/src/commandoptions.h b/src/commandoptions.h --- a/src/commandoptions.h +++ b/src/commandoptions.h @@ -42,7 +42,6 @@ { CMD_ERROR, // error in command line options NONE, // no command - EXIT, // print outputText() and exit TRAY, // --tray TRIGGER_EVENT, // --triggerEvent CANCEL_EVENT, // --cancelEvent diff --git a/src/commandoptions.cpp b/src/commandoptions.cpp --- a/src/commandoptions.cpp +++ b/src/commandoptions.cpp @@ -243,28 +243,12 @@ void CommandOptions::parse() { - if (!mParser->parse(mNonExecArguments)) - { - setError(mParser->errorText()); - return; - } - if (mParser->isSet(QStringLiteral("help"))) - { - mCommand = EXIT; - mError = mParser->helpText(); - return; - } - if (mParser->isSet(QStringLiteral("version"))) - { - mCommand = EXIT; - mError = QCoreApplication::applicationName() + QLatin1String(" ") + QCoreApplication::applicationVersion(); - return; - } + mParser->process(mNonExecArguments); } void CommandOptions::process() { - if (mCommand == CMD_ERROR || mCommand == EXIT) + if (mCommand == CMD_ERROR) return; #ifndef NDEBUG diff --git a/src/kalarmapp.cpp b/src/kalarmapp.cpp --- a/src/kalarmapp.cpp +++ b/src/kalarmapp.cpp @@ -391,15 +391,6 @@ mReadOnly = true; // don't need write access to calendars exitCode = 1; break; - case CommandOptions::EXIT: - if (outputText) - { - *outputText = options->outputText(); - delete options; - return 0; - } - exitCode = -1; - break; default: break; }