Changeset View
Changeset View
Standalone View
Standalone View
src/kpackagetool/options.h
1 | #ifndef OPTIONS_H | 1 | #ifndef OPTIONS_H | ||
---|---|---|---|---|---|
2 | #define OPTIONS_H | 2 | #define OPTIONS_H | ||
3 | 3 | | |||
4 | #include <QCommandLineOption> | 4 | #include <QCommandLineOption> | ||
5 | 5 | | |||
6 | namespace Options | 6 | namespace Options | ||
7 | { | 7 | { | ||
8 | static QCommandLineOption hash { | 8 | static QCommandLineOption hash() { | ||
9 | static QCommandLineOption o { | ||||
9 | QStringLiteral("hash"), i18nc("Do not translate <path>", "Generate a SHA1 hash for the package at <path>"), QStringLiteral("path") | 10 | QStringLiteral("hash"), i18nc("Do not translate <path>", "Generate a SHA1 hash for the package at <path>"), QStringLiteral("path") | ||
10 | }; | 11 | }; | ||
11 | static QCommandLineOption global { | 12 | return o; | ||
13 | } | ||||
14 | static QCommandLineOption global() { | ||||
15 | static QCommandLineOption o { | ||||
12 | QStringList { QStringLiteral("g"), QStringLiteral("global") }, | 16 | QStringList { QStringLiteral("g"), QStringLiteral("global") }, | ||
13 | i18n("For install or remove, operates on packages installed for all users.") | 17 | i18n("For install or remove, operates on packages installed for all users.") | ||
14 | }; | 18 | }; | ||
15 | static QCommandLineOption type { | 19 | return o; | ||
20 | } | ||||
21 | static QCommandLineOption type() { | ||||
22 | static QCommandLineOption o { | ||||
16 | QStringList { QStringLiteral("t"), QStringLiteral("type") }, | 23 | QStringList { QStringLiteral("t"), QStringLiteral("type") }, | ||
17 | i18nc("theme, wallpaper, etc. are keywords, but they may be translated, as both versions " | 24 | i18nc("theme, wallpaper, etc. are keywords, but they may be translated, as both versions " | ||
18 | "are recognized by the application " | 25 | "are recognized by the application " | ||
19 | "(if translated, should be same as messages with 'package type' context below)", | 26 | "(if translated, should be same as messages with 'package type' context below)", | ||
20 | "The type of package, corresponding to the service type of the package plugin, e.g. KPackage/Generic, Plasma/Theme, Plasma/Wallpaper, Plasma/Applet, etc."), | 27 | "The type of package, corresponding to the service type of the package plugin, e.g. KPackage/Generic, Plasma/Theme, Plasma/Wallpaper, Plasma/Applet, etc."), | ||
21 | QStringLiteral("type"), QStringLiteral("KPackage/Generic") | 28 | QStringLiteral("type"), QStringLiteral("KPackage/Generic") | ||
22 | }; | 29 | }; | ||
23 | static QCommandLineOption install { | 30 | return o; | ||
31 | } | ||||
32 | static QCommandLineOption install() { | ||||
33 | static QCommandLineOption o { | ||||
24 | QStringList { QStringLiteral("i"), QStringLiteral("install") }, | 34 | QStringList { QStringLiteral("i"), QStringLiteral("install") }, | ||
25 | i18nc("Do not translate <path>", "Install the package at <path>"), | 35 | i18nc("Do not translate <path>", "Install the package at <path>"), | ||
26 | QStringLiteral("path") | 36 | QStringLiteral("path") | ||
27 | }; | 37 | }; | ||
28 | static QCommandLineOption show { | 38 | return o; | ||
39 | } | ||||
40 | static QCommandLineOption show() { | ||||
41 | static QCommandLineOption o { | ||||
29 | QStringList { QStringLiteral("s"), QStringLiteral("show") }, | 42 | QStringList { QStringLiteral("s"), QStringLiteral("show") }, | ||
30 | i18nc("Do not translate <name>", "Show information of package <name>"), | 43 | i18nc("Do not translate <name>", "Show information of package <name>"), | ||
31 | QStringLiteral("name") | 44 | QStringLiteral("name") | ||
32 | }; | 45 | }; | ||
33 | static QCommandLineOption upgrade { | 46 | return o; | ||
47 | } | ||||
48 | static QCommandLineOption upgrade() { | ||||
49 | static QCommandLineOption o { | ||||
34 | QStringList { QStringLiteral("u"), QStringLiteral("upgrade") }, | 50 | QStringList { QStringLiteral("u"), QStringLiteral("upgrade") }, | ||
35 | i18nc("Do not translate <path>", "Upgrade the package at <path>"), | 51 | i18nc("Do not translate <path>", "Upgrade the package at <path>"), | ||
36 | QStringLiteral("path") | 52 | QStringLiteral("path") | ||
37 | }; | 53 | }; | ||
38 | static QCommandLineOption list { | 54 | return o; | ||
39 | QStringList { QStringLiteral("l"), QStringLiteral("list") }, | 55 | } | ||
40 | i18n("List installed packages") | 56 | static QCommandLineOption list() { | ||
57 | static QCommandLineOption o { | ||||
58 | QStringList { QStringLiteral("l"), QStringLiteral("list") }, i18n("List installed packages") | ||||
41 | }; | 59 | }; | ||
42 | static QCommandLineOption listTypes { | 60 | return o; | ||
61 | } | ||||
62 | static QCommandLineOption listTypes() { | ||||
63 | static QCommandLineOption o { | ||||
43 | QStringList { QStringLiteral("list-types") }, | 64 | QStringList { QStringLiteral("list-types") }, | ||
44 | i18n("List all known package types that can be installed") | 65 | i18n("List all known package types that can be installed") | ||
45 | }; | 66 | }; | ||
46 | static QCommandLineOption remove { | 67 | return o; | ||
68 | } | ||||
69 | static QCommandLineOption remove() { | ||||
70 | static QCommandLineOption o { | ||||
47 | QStringList { QStringLiteral("r"), QStringLiteral("remove") }, | 71 | QStringList { QStringLiteral("r"), QStringLiteral("remove") }, | ||
48 | i18nc("Do not translate <name>", "Remove the package named <name>"), | 72 | i18nc("Do not translate <name>", "Remove the package named <name>"), | ||
49 | QStringLiteral("name") | 73 | QStringLiteral("name") | ||
50 | }; | 74 | }; | ||
51 | static QCommandLineOption packageRoot { | 75 | return o; | ||
76 | } | ||||
77 | static QCommandLineOption packageRoot() { | ||||
78 | static QCommandLineOption o { | ||||
52 | QStringList { QStringLiteral("p"), QStringLiteral("packageroot") }, | 79 | QStringList { QStringLiteral("p"), QStringLiteral("packageroot") }, | ||
53 | i18n("Absolute path to the package root. If not supplied, then the standard data" | 80 | i18n("Absolute path to the package root. If not supplied, then the standard data" | ||
54 | " directories for this KDE session will be searched instead."), | 81 | " directories for this KDE session will be searched instead."), | ||
55 | QStringLiteral("path") | 82 | QStringLiteral("path") | ||
56 | }; | 83 | }; | ||
57 | static QCommandLineOption generateIndex { | 84 | return o; | ||
85 | } | ||||
86 | static QCommandLineOption generateIndex() { | ||||
87 | static QCommandLineOption o { | ||||
58 | QStringLiteral("generate-index"), | 88 | QStringLiteral("generate-index"), | ||
59 | i18n("Recreate the plugin index. To be used in conjunction with either the option -t or" | 89 | i18n("Recreate the plugin index. To be used in conjunction with either the option -t or" | ||
60 | " -g. Recreates the index for the given type or package root. Operates in the user" | 90 | " -g. Recreates the index for the given type or package root. Operates in the user" | ||
61 | " directory, unless -g is used") | 91 | " directory, unless -g is used") | ||
62 | }; | 92 | }; | ||
63 | static QCommandLineOption removeIndex { | 93 | return o; | ||
94 | } | ||||
95 | static QCommandLineOption removeIndex() { | ||||
96 | static QCommandLineOption o { | ||||
64 | QStringLiteral("remove-index"), | 97 | QStringLiteral("remove-index"), | ||
65 | i18n("Remove the plugin index. To be used in conjunction with either the option -t or" | 98 | i18n("Remove the plugin index. To be used in conjunction with either the option -t or" | ||
66 | " -g. Recreates the index for the given type or package root. Operates in the user" | 99 | " -g. Recreates the index for the given type or package root. Operates in the user" | ||
67 | " directory, unless -g is used") | 100 | " directory, unless -g is used") | ||
68 | }; | 101 | }; | ||
69 | static QCommandLineOption appstream { | 102 | return o; | ||
103 | } | ||||
104 | static QCommandLineOption appstream() { | ||||
105 | static QCommandLineOption o { | ||||
70 | QStringLiteral("appstream-metainfo"), | 106 | QStringLiteral("appstream-metainfo"), | ||
71 | i18nc("Do not translate <path>", "Outputs the metadata for the package <path>"), | 107 | i18nc("Do not translate <path>", "Outputs the metadata for the package <path>"), | ||
72 | QStringLiteral("path") | 108 | QStringLiteral("path") | ||
73 | }; | 109 | }; | ||
74 | static QCommandLineOption appstreamOutput { | 110 | return o; | ||
111 | } | ||||
112 | static QCommandLineOption appstreamOutput() { | ||||
113 | static QCommandLineOption o { | ||||
75 | QStringLiteral("appstream-metainfo-output"), | 114 | QStringLiteral("appstream-metainfo-output"), | ||
76 | i18nc("Do not translate <path>", "Outputs the metadata for the package into <path>"), | 115 | i18nc("Do not translate <path>", "Outputs the metadata for the package into <path>"), | ||
77 | QStringLiteral("path") | 116 | QStringLiteral("path") | ||
78 | }; | 117 | }; | ||
118 | return o; | ||||
119 | } | ||||
79 | } | 120 | } | ||
80 | 121 | | |||
81 | #endif // OPTIONS_H | 122 | #endif // OPTIONS_H |