diff options
author | Denys Vlasenko <dvlasenk@redhat.com> | 2011-01-20 21:32:58 +0100 |
---|---|---|
committer | Denys Vlasenko <dvlasenk@redhat.com> | 2011-01-20 21:32:58 +0100 |
commit | a0dc58e8355a0d4b98b9c88e0f26172b1418d7c9 (patch) | |
tree | 7baf8c43b8530cfd2d5557a6ae7479595e1c6fea /src/lib/parse_options.h | |
parent | 3380e13c62e1b7a8309423f4eccfb4b6cbaa0310 (diff) | |
download | abrt-a0dc58e8355a0d4b98b9c88e0f26172b1418d7c9.tar.gz abrt-a0dc58e8355a0d4b98b9c88e0f26172b1418d7c9.tar.xz abrt-a0dc58e8355a0d4b98b9c88e0f26172b1418d7c9.zip |
add OPT_LIST mechanism to handle multiply occurring options
This allowed to convert abrt-action-bugzilla, abrt-action-rhtsupport
and abrt-action-kerneloops to parse_opts()
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
Diffstat (limited to 'src/lib/parse_options.h')
-rw-r--r-- | src/lib/parse_options.h | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/lib/parse_options.h b/src/lib/parse_options.h index 05d6fd90..82f3c6b8 100644 --- a/src/lib/parse_options.h +++ b/src/lib/parse_options.h @@ -28,6 +28,7 @@ enum parse_opt_type { OPTION_STRING, OPTION_INTEGER, OPTION_OPTSTRING, + OPTION_LIST, OPTION_END, }; @@ -44,16 +45,17 @@ struct options { * s - short_name * l - long_name * v - value - * a - argh argument help + * a - option parameter name (for help text) * h - help */ #define OPT_END() { OPTION_END } #define OPT_BOOL(s, l, v, h) { OPTION_BOOL, (s), (l), (v), NULL, (h) } -#define OPT_INTEGER(s, l, v, h) { OPTION_INTEGER, (s), (l), (v), "n", (h) } +#define OPT_INTEGER(s, l, v, h) { OPTION_INTEGER, (s), (l), (v), "NUM", (h) } #define OPT_STRING(s, l, v, a, h) { OPTION_STRING, (s), (l), (v), (a), (h) } #define OPT_OPTSTRING(s, l, v, a, h) { OPTION_OPTSTRING, (s), (l), (v), (a), (h) } +#define OPT_LIST(s, l, v, a, h) { OPTION_LIST, (s), (l), (v), (a), (h) } -#define OPT__VERBOSE(v) OPT_BOOL('v', "verbose", (v), "Be verbose") +#define OPT__VERBOSE(v) OPT_BOOL('v', "verbose", (v), _("Be verbose")) #define parse_opts abrt_parse_opts unsigned parse_opts(int argc, char **argv, const struct options *opt, |