diff options
-rw-r--r-- | src/libs/installer/commandlineparser.cpp | 14 | ||||
-rw-r--r-- | src/libs/installer/constants.h | 12 | ||||
-rw-r--r-- | src/sdk/main.cpp | 6 | ||||
-rw-r--r-- | src/sdk/sdkapp.h | 16 |
4 files changed, 29 insertions, 19 deletions
diff --git a/src/libs/installer/commandlineparser.cpp b/src/libs/installer/commandlineparser.cpp index 1a63aa295..23d5d04e0 100644 --- a/src/libs/installer/commandlineparser.cpp +++ b/src/libs/installer/commandlineparser.cpp @@ -155,17 +155,21 @@ CommandLineParser::CommandLineParser() "has no effect on online installers."))); // Message query options - m_parser.addOption(QCommandLineOption(QStringList() << CommandLineOptions::scAcceptMessageQuery, + m_parser.addOption(QCommandLineOption(QStringList() << CommandLineOptions::scAcceptMessageQueryShort + << CommandLineOptions::scAcceptMessageQueryLong, QLatin1String("[CLI] Accepts all message queries without user input."))); - m_parser.addOption(QCommandLineOption(QStringList() << CommandLineOptions::scRejectMessageQuery, + m_parser.addOption(QCommandLineOption(QStringList() << CommandLineOptions::scRejectMessageQueryShort + << CommandLineOptions::scRejectMessageQueryLong, QLatin1String("[CLI] Rejects all message queries without user input."))); - m_parser.addOption(QCommandLineOption(QStringList() << CommandLineOptions::scMessageAutomaticAnswer, + m_parser.addOption(QCommandLineOption(QStringList() << CommandLineOptions::scMessageAutomaticAnswerShort + << CommandLineOptions::scMessageAutomaticAnswerLong, QLatin1String("[CLI] Automatically answers the message queries with the message identifier and button value. " "Several identifier=value pairs can be given separated with comma, " "for example --auto-answer message.id=Ok,message.id2=Cancel."), QLatin1String("identifier=value"))); - m_parser.addOption(QCommandLineOption(QStringList() << CommandLineOptions::scMessageDefaultAnswer, - QLatin1String("[CLI] Automatically answers to message queries with their default values."))); + m_parser.addOption(QCommandLineOption(QStringList() << CommandLineOptions::scMessageDefaultAnswerShort + << CommandLineOptions::scMessageDefaultAnswerLong, + QLatin1String("[CLI] Automatically answers to message queries with their default values."))); m_parser.addOption(QCommandLineOption(QStringList() << CommandLineOptions::scAcceptLicenses, QLatin1String("[CLI] Accepts all licenses without user input."))); m_parser.addOption(QCommandLineOption(QStringList() << CommandLineOptions::scFileDialogAutomaticAnswer, diff --git a/src/libs/installer/constants.h b/src/libs/installer/constants.h index f600ed033..8b73e606c 100644 --- a/src/libs/installer/constants.h +++ b/src/libs/installer/constants.h @@ -155,10 +155,14 @@ static const QLatin1String scStartUninstallerShort("sr"); static const QLatin1String scStartUninstallerLong("start-uninstaller"); // Message acceptance options -static const QLatin1String scAcceptMessageQuery("accept-messages"); -static const QLatin1String scRejectMessageQuery("reject-messages"); -static const QLatin1String scMessageAutomaticAnswer("auto-answer"); -static const QLatin1String scMessageDefaultAnswer("default-answer"); +static const QLatin1String scAcceptMessageQueryShort("am"); +static const QLatin1String scAcceptMessageQueryLong("accept-messages"); +static const QLatin1String scRejectMessageQueryShort("rm"); +static const QLatin1String scRejectMessageQueryLong("reject-messages"); +static const QLatin1String scMessageAutomaticAnswerShort("aa"); +static const QLatin1String scMessageAutomaticAnswerLong("auto-answer"); +static const QLatin1String scMessageDefaultAnswerShort("da"); +static const QLatin1String scMessageDefaultAnswerLong("default-answer"); static const QLatin1String scAcceptLicenses("accept-licenses"); static const QLatin1String scFileDialogAutomaticAnswer("file-query"); static const QLatin1String scConfirmCommand("confirm-command"); diff --git a/src/sdk/main.cpp b/src/sdk/main.cpp index 9b425bc98..cc6e247e0 100644 --- a/src/sdk/main.cpp +++ b/src/sdk/main.cpp @@ -98,9 +98,9 @@ int main(int argc, char *argv[]) } if (mutually.isEmpty()) { mutually = QInstaller::checkMutualOptions(parser, QStringList() - << CommandLineOptions::scAcceptMessageQuery - << CommandLineOptions::scRejectMessageQuery - << CommandLineOptions::scMessageDefaultAnswer); + << CommandLineOptions::scAcceptMessageQueryLong + << CommandLineOptions::scRejectMessageQueryLong + << CommandLineOptions::scMessageDefaultAnswerLong); } if (mutually.isEmpty()) { mutually = QInstaller::checkMutualOptions(parser, QStringList() diff --git a/src/sdk/sdkapp.h b/src/sdk/sdkapp.h index 83a76fcbb..2a2a36f2d 100644 --- a/src/sdk/sdkapp.h +++ b/src/sdk/sdkapp.h @@ -297,24 +297,25 @@ public: // Ignore message acceptance options when running the installer with GUI if (m_core->isCommandLineInstance()) { - if (m_parser.isSet(CommandLineOptions::scAcceptMessageQuery)) + if (m_parser.isSet(CommandLineOptions::scAcceptMessageQueryLong)) m_core->autoAcceptMessageBoxes(); - if (m_parser.isSet(CommandLineOptions::scRejectMessageQuery)) + if (m_parser.isSet(CommandLineOptions::scRejectMessageQueryLong)) m_core->autoRejectMessageBoxes(); - if (m_parser.isSet(CommandLineOptions::scMessageDefaultAnswer)) + if (m_parser.isSet(CommandLineOptions::scMessageDefaultAnswerLong)) m_core->acceptMessageBoxDefaultButton(); - if (m_parser.isSet(CommandLineOptions::scMessageAutomaticAnswer)) { - const QString positionalArguments = m_parser.value(CommandLineOptions::scMessageAutomaticAnswer); + if (m_parser.isSet(CommandLineOptions::scMessageAutomaticAnswerLong)) { + const QString positionalArguments = m_parser.value(CommandLineOptions::scMessageAutomaticAnswerLong); const QStringList items = positionalArguments.split(QLatin1Char(','), QString::SkipEmptyParts); if (items.count() > 0) { errorMessage = setMessageBoxAutomaticAnswers(items); if (!errorMessage.isEmpty()) return false; } else { - errorMessage = QObject::tr("Arguments missing for option %1").arg(CommandLineOptions::scMessageAutomaticAnswer); + errorMessage = QObject::tr("Arguments missing for option %1") + .arg(CommandLineOptions::scMessageAutomaticAnswerLong); return false; } } @@ -465,7 +466,8 @@ public: return QObject::tr("Invalid button value %1 ").arg(value); } } else { - return QObject::tr("Incorrect arguments for %1").arg(CommandLineOptions::scMessageAutomaticAnswer); + return QObject::tr("Incorrect arguments for %1") + .arg(CommandLineOptions::scMessageAutomaticAnswerLong); } } return QString(); |