File indexing completed on 2023-09-24 04:10:43
0001 #ifndef OPTIONS_H 0002 #define OPTIONS_H 0003 0004 #include <QCommandLineOption> 0005 0006 namespace Options 0007 { 0008 static QCommandLineOption hash() 0009 { 0010 static QCommandLineOption o{QStringLiteral("hash"), 0011 i18nc("Do not translate <path>", "Generate a SHA1 hash for the package at <path>"), 0012 QStringLiteral("path")}; 0013 return o; 0014 } 0015 static QCommandLineOption global() 0016 { 0017 static QCommandLineOption o{QStringList{QStringLiteral("g"), QStringLiteral("global")}, 0018 i18n("For install or remove, operates on packages installed for all users.")}; 0019 return o; 0020 } 0021 static QCommandLineOption type() 0022 { 0023 static QCommandLineOption o{QStringList{QStringLiteral("t"), QStringLiteral("type")}, 0024 i18nc("theme, wallpaper, etc. are keywords, but they may be translated, as both versions " 0025 "are recognized by the application " 0026 "(if translated, should be same as messages with 'package type' context below)", 0027 "The type of package, corresponding to the service type of the package plugin, e.g. KPackage/Generic, Plasma/Theme, " 0028 "Plasma/Wallpaper, Plasma/Applet, etc."), 0029 QStringLiteral("type"), 0030 QStringLiteral("KPackage/Generic")}; 0031 return o; 0032 } 0033 static QCommandLineOption install() 0034 { 0035 static QCommandLineOption o{QStringList{QStringLiteral("i"), QStringLiteral("install")}, 0036 i18nc("Do not translate <path>", "Install the package at <path>"), 0037 QStringLiteral("path")}; 0038 return o; 0039 } 0040 static QCommandLineOption show() 0041 { 0042 static QCommandLineOption o{QStringList{QStringLiteral("s"), QStringLiteral("show")}, 0043 i18nc("Do not translate <name>", "Show information of package <name>"), 0044 QStringLiteral("name")}; 0045 return o; 0046 } 0047 static QCommandLineOption upgrade() 0048 { 0049 static QCommandLineOption o{QStringList{QStringLiteral("u"), QStringLiteral("upgrade")}, 0050 i18nc("Do not translate <path>", "Upgrade the package at <path>"), 0051 QStringLiteral("path")}; 0052 return o; 0053 } 0054 static QCommandLineOption list() 0055 { 0056 static QCommandLineOption o{QStringList{QStringLiteral("l"), QStringLiteral("list")}, i18n("List installed packages")}; 0057 return o; 0058 } 0059 static QCommandLineOption listTypes() 0060 { 0061 static QCommandLineOption o{QStringList{QStringLiteral("list-types")}, i18n("List all known package types that can be installed")}; 0062 return o; 0063 } 0064 static QCommandLineOption remove() 0065 { 0066 static QCommandLineOption o{QStringList{QStringLiteral("r"), QStringLiteral("remove")}, 0067 i18nc("Do not translate <name>", "Remove the package named <name>"), 0068 QStringLiteral("name")}; 0069 return o; 0070 } 0071 static QCommandLineOption packageRoot() 0072 { 0073 static QCommandLineOption o{QStringList{QStringLiteral("p"), QStringLiteral("packageroot")}, 0074 i18n("Absolute path to the package root. If not supplied, then the standard data" 0075 " directories for this KDE session will be searched instead."), 0076 QStringLiteral("path")}; 0077 return o; 0078 } 0079 static QCommandLineOption generateIndex() 0080 { 0081 static QCommandLineOption o{QStringLiteral("generate-index"), 0082 i18n("Recreate the plugin index. To be used in conjunction with either the option -t or" 0083 " -g. Recreates the index for the given type or package root. Operates in the user" 0084 " directory, unless -g is used")}; 0085 return o; 0086 } 0087 static QCommandLineOption removeIndex() 0088 { 0089 static QCommandLineOption o{QStringLiteral("remove-index"), 0090 i18n("Remove the plugin index. To be used in conjunction with either the option -t or" 0091 " -g. Recreates the index for the given type or package root. Operates in the user" 0092 " directory, unless -g is used")}; 0093 return o; 0094 } 0095 static QCommandLineOption appstream() 0096 { 0097 static QCommandLineOption o{QStringLiteral("appstream-metainfo"), 0098 i18nc("Do not translate <path>", "Outputs the metadata for the package <path>"), 0099 QStringLiteral("path")}; 0100 return o; 0101 } 0102 static QCommandLineOption appstreamOutput() 0103 { 0104 static QCommandLineOption o{QStringLiteral("appstream-metainfo-output"), 0105 i18nc("Do not translate <path>", "Outputs the metadata for the package into <path>"), 0106 QStringLiteral("path")}; 0107 return o; 0108 } 0109 } 0110 0111 #endif // OPTIONS_H