static string help_global_options = _(" Global Options:\n"
"\t--help, -h\t\tHelp.\n"
"\t--version, -V\t\tOutput the version number.\n"
+ "\t--promptids\t\tOutput a list of zypper's user prompts.\n"
"\t--config, -c <file>\tUse specified config file instead of the default.\n"
"\t--quiet, -q\t\tSuppress normal output, print only error\n"
"\t\t\t\tmessages.\n"
{"verbose", no_argument, 0, 'v'},
{"quiet", no_argument, 0, 'q'},
{"version", no_argument, 0, 'V'},
+ {"promptids", no_argument, 0, 0 },
// rug compatibility alias for -vv
{"debug", no_argument, 0, 0 },
// rug compatibility alias for the default output level => ignored
}
}
}
- else if (!gopts.count("version"))
+ else if (!(gopts.count("version") || gopts.count("promptids")))
setRunningHelp();
if (command() == ZypperCommand::HELP)
out().info(PACKAGE " " VERSION, Out::QUIET);
ZYPP_THROW(ExitRequestException("version shown"));
}
+ else if (gopts.count("promptids"))
+ {
+ #define PR_ENUML(nam, val) out().info(#nam "=" #val, Out::QUIET);
+ #define PR_ENUM(nam, val) PR_ENUML(nam, val)
+ #include "output/prompt.h"
+ ZYPP_THROW(ExitRequestException("promptids shown"));
+ }
else
{
print_unknown_command_hint(*this);
#ifndef PROMPT_H_
-#define PROMPT_H_
+ #ifndef PR_ENUML
+ #define PR_ENUML(nam, val) nam = val
+ #else
+ #define PR_MAN
+ #endif
+ #ifndef PR_ENUM
+ #define PR_ENUM(nam, val) PR_ENUML(nam, val),
+ #endif
+#else
+ #ifndef PR_ENUML
+ #define PR_ENUML(nam, val)
+ #define PR_ENUM(nam, val)
+ #else
+ #define PR_MAN
+ #ifndef PR_ENUM
+ #define PR_ENUM(nam, val) PR_ENUML(nam, val),
+ #endif
+ #endif
+#endif
/**
* Defines identifiers of zypper's user prompts. Used in machine-readable output
* </table>
* \todo add the description of the rest
*/
+#ifndef PROMPT_H_
+#ifndef PR_MAN
typedef enum
{
- PROMPT_YN_INST_REMOVE_CONTINUE = 0,
- PROMPT_DEP_RESOLVE = 1,
- PROMPT_AUTH_USERNAME = 2,
- PROMPT_AUTH_PASSWORD = 3,
- PROMPT_ARI_RPM_DOWNLOAD_PROBLEM = 4,
- PROMPT_ARI_REPO_PROBLEM = 5,
- PROMPT_ARI_RPM_REMOVE_PROBLEM = 6,
- PROMPT_ARI_RPM_INSTALL_PROBLEM = 7,
- PROMPT_ARI_MEDIA_PROBLEM = 8,
- PROMPT_YN_MEDIA_CHANGE = 9,
- PROMPT_YN_LICENSE_AGREE = 10,
- PROMPT_YN_GPG_UNSIGNED_FILE_ACCEPT = 11,
-// PROMPT_YN_GPG_KEY_IMPORT_TRUSTED = 12,
- PROMPT_YN_GPG_UNKNOWN_KEY_ACCEPT = 13,
- PROMPT_YN_GPG_KEY_TRUST = 14,
- PROMPT_YN_GPG_CHECK_FAILED_IGNORE = 15,
- PROMPT_GPG_NO_DIGEST_ACCEPT = 16,
- PROMPT_GPG_UNKNOWN_DIGEST_ACCEPT = 17,
- PROMPT_GPG_WRONG_DIGEST_ACCEPT = 18,
- PROMPT_YN_REMOVE_LOCK = 19,
- PROMPT_PATCH_MESSAGE_CONTINUE = 20,
- PROMPT_ARI_PATCH_SCRIPT_PROBLEM = 21,
- PROMPT_MEDIA_EJECT = 22,
- PROMPT_PACKAGEKIT_QUIT = 23
+#endif
+#endif
+ PR_ENUM(PROMPT_YN_INST_REMOVE_CONTINUE, 0)
+ PR_ENUM(PROMPT_DEP_RESOLVE, 1)
+ PR_ENUM(PROMPT_AUTH_USERNAME, 2)
+ PR_ENUM(PROMPT_AUTH_PASSWORD, 3)
+ PR_ENUM(PROMPT_ARI_RPM_DOWNLOAD_PROBLEM, 4)
+ PR_ENUM(PROMPT_ARI_REPO_PROBLEM, 5)
+ PR_ENUM(PROMPT_ARI_RPM_REMOVE_PROBLEM, 6)
+ PR_ENUM(PROMPT_ARI_RPM_INSTALL_PROBLEM, 7)
+ PR_ENUM(PROMPT_ARI_MEDIA_PROBLEM, 8)
+ PR_ENUM(PROMPT_YN_MEDIA_CHANGE, 9)
+ PR_ENUM(PROMPT_YN_LICENSE_AGREE, 10)
+ PR_ENUM(PROMPT_YN_GPG_UNSIGNED_FILE_ACCEPT, 11)
+// PR_ENUM(PROMPT_YN_GPG_KEY_IMPORT_TRUSTED, 12)
+ PR_ENUM(PROMPT_YN_GPG_UNKNOWN_KEY_ACCEPT, 13)
+ PR_ENUM(PROMPT_YN_GPG_KEY_TRUST, 14)
+ PR_ENUM(PROMPT_YN_GPG_CHECK_FAILED_IGNORE, 15)
+ PR_ENUM(PROMPT_GPG_NO_DIGEST_ACCEPT, 16)
+ PR_ENUM(PROMPT_GPG_UNKNOWN_DIGEST_ACCEPT, 17)
+ PR_ENUM(PROMPT_GPG_WRONG_DIGEST_ACCEPT, 18)
+ PR_ENUM(PROMPT_YN_REMOVE_LOCK, 19)
+ PR_ENUM(PROMPT_PATCH_MESSAGE_CONTINUE, 20)
+ PR_ENUM(PROMPT_ARI_PATCH_SCRIPT_PROBLEM, 21)
+ PR_ENUM(PROMPT_MEDIA_EJECT, 22)
+ PR_ENUML(PROMPT_PACKAGEKIT_QUIT, 23)
+#ifndef PROMPT_H_
+#define PROMPT_H_
+#ifndef PR_MAN
} PromptId;
+#endif
#endif /*PROMPT_H_*/
+
+#undef PR_ENUM
+#undef PR_ENUML
+#undef PR_MAN