Commit fafcd270 authored by Ingo Klöcker's avatar Ingo Klöcker
Browse files

Use list-initialization for command line options

parent 5b1c8324
Pipeline #200406 failed with stage
in 2 minutes and 13 seconds
......@@ -16,63 +16,31 @@
static void kleopatra_options(QCommandLineParser *parser)
{
QList<QCommandLineOption> options;
options << QCommandLineOption(QStringList() << QStringLiteral("openpgp")
<< QStringLiteral("p"),
i18n("Use OpenPGP for the following operation"))
<< QCommandLineOption(QStringList() << QStringLiteral("cms")
<< QStringLiteral("c"),
i18n("Use CMS (X.509, S/MIME) for the following operation"))
parser->addOptions({
QCommandLineOption({QStringLiteral("openpgp"), QStringLiteral("p")}, i18n("Use OpenPGP for the following operation")),
QCommandLineOption({QStringLiteral("cms"), QStringLiteral("c")}, i18n("Use CMS (X.509, S/MIME) for the following operation")),
#ifdef HAVE_USABLE_ASSUAN
<< QCommandLineOption(QStringLiteral("uiserver-socket"),
i18n("Location of the socket the ui server is listening on"),
QStringLiteral("argument"))
<< QCommandLineOption(QStringLiteral("daemon"),
i18n("Run UI server only, hide main window"))
QCommandLineOption(QStringLiteral("uiserver-socket"), i18n("Location of the socket the ui server is listening on"), QStringLiteral("argument")),
QCommandLineOption(QStringLiteral("daemon"), i18n("Run UI server only, hide main window")),
#endif
<< QCommandLineOption(QStringList() << QStringLiteral("import-certificate")
<< QStringLiteral("i"),
i18n("Import certificate file(s)"))
<< QCommandLineOption(QStringList() << QStringLiteral("encrypt")
<< QStringLiteral("e"),
i18n("Encrypt file(s)"))
<< QCommandLineOption(QStringList() << QStringLiteral("sign")
<< QStringLiteral("s"),
i18n("Sign file(s)"))
<< QCommandLineOption(QStringList() << QStringLiteral("sign-encrypt")
<< QStringLiteral("E"),
i18n("Sign and/or encrypt file(s)"))
<< QCommandLineOption(QStringLiteral("encrypt-sign"),
i18n("Same as --sign-encrypt, do not use"))
<< QCommandLineOption(QStringList() << QStringLiteral("decrypt")
<< QStringLiteral("d"),
i18n("Decrypt file(s)"))
<< QCommandLineOption(QStringList() << QStringLiteral("verify")
<< QStringLiteral("V"),
i18n("Verify file/signature"))
<< QCommandLineOption(QStringList() << QStringLiteral("decrypt-verify")
<< QStringLiteral("D"),
i18n("Decrypt and/or verify file(s)"))
<< QCommandLineOption(QStringList() << QStringLiteral("search"),
i18n("Search for a certificate on a keyserver"))
<< QCommandLineOption(QStringList() << QStringLiteral("checksum"),
i18n("Create or check a checksum file"))
<< QCommandLineOption(QStringList() << QStringLiteral("query")
<< QStringLiteral("q"),
i18nc("If a certificate is already known it shows the certificate details dialog."
"Otherwise it brings up the certificate search dialog.",
"Show details of a local certificate or search for it on a keyserver"
" by fingerprint"))
<< QCommandLineOption(QStringList() << QStringLiteral("gen-key"),
i18n("Create a new key pair or certificate signing request"))
<< QCommandLineOption(QStringLiteral("parent-windowid"),
i18n("Parent Window Id for dialogs"),
QStringLiteral("windowId"))
<< QCommandLineOption(QStringList() << QStringLiteral("config"),
i18n("Open the config dialog"));
parser->addOptions(options);
QCommandLineOption({QStringLiteral("import-certificate"), QStringLiteral("i")}, i18n("Import certificate file(s)")),
QCommandLineOption({QStringLiteral("encrypt"), QStringLiteral("e")}, i18n("Encrypt file(s)")),
QCommandLineOption({QStringLiteral("sign"), QStringLiteral("s")}, i18n("Sign file(s)")),
QCommandLineOption({QStringLiteral("sign-encrypt"), QStringLiteral("E")}, i18n("Sign and/or encrypt file(s)")),
QCommandLineOption(QStringLiteral("encrypt-sign"), i18n("Same as --sign-encrypt, do not use")),
QCommandLineOption({QStringLiteral("decrypt"), QStringLiteral("d")}, i18n("Decrypt file(s)")),
QCommandLineOption({QStringLiteral("verify"), QStringLiteral("V")}, i18n("Verify file/signature")),
QCommandLineOption({QStringLiteral("decrypt-verify"), QStringLiteral("D")}, i18n("Decrypt and/or verify file(s)")),
QCommandLineOption(QStringLiteral("search"), i18n("Search for a certificate on a keyserver")),
QCommandLineOption(QStringLiteral("checksum"), i18n("Create or check a checksum file")),
QCommandLineOption({QStringLiteral("query"), QStringLiteral("q")},
i18nc("If a certificate is already known it shows the certificate details dialog. "
"Otherwise it brings up the certificate search dialog.",
"Show details of a local certificate or search for it on a keyserver by fingerprint")),
QCommandLineOption(QStringLiteral("gen-key"), i18n("Create a new key pair or certificate signing request")),
QCommandLineOption(QStringLiteral("parent-windowid"), i18n("Parent Window Id for dialogs"), QStringLiteral("windowId")),
QCommandLineOption(QStringLiteral("config"), i18n("Open the config dialog")),
});
/* Security note: To avoid code execution by shared library injection
* through e.g. -platformpluginpath any external input should be seperated
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment