diff options
author | Karel Klic <kklic@redhat.com> | 2011-03-01 13:32:41 +0100 |
---|---|---|
committer | Karel Klic <kklic@redhat.com> | 2011-03-01 13:32:41 +0100 |
commit | 67b220a26b0ec43384693819b185915a6903720d (patch) | |
tree | 0a44fbdbed8251aa8f79136349ca5c27c6c4ad26 | |
parent | 85f639b7fe277ba327e5013e5b101b4a67f14e1d (diff) | |
download | abrt-67b220a26b0ec43384693819b185915a6903720d.tar.gz abrt-67b220a26b0ec43384693819b185915a6903720d.tar.xz abrt-67b220a26b0ec43384693819b185915a6903720d.zip |
Revert "Remove unused OPTION_GROUP", because OPT_GROUP is used by
abrt-retrace-client. This reverts commit
3380e13c62e1b7a8309423f4eccfb4b6cbaa0310.
-rw-r--r-- | src/lib/parse_options.c | 13 | ||||
-rw-r--r-- | src/lib/parse_options.h | 2 | ||||
-rw-r--r-- | src/plugins/Makefile.am | 2 |
3 files changed, 16 insertions, 1 deletions
diff --git a/src/lib/parse_options.c b/src/lib/parse_options.c index 3d631461..4f2b2a2b 100644 --- a/src/lib/parse_options.c +++ b/src/lib/parse_options.c @@ -28,13 +28,22 @@ void show_usage_and_die(const char *usage, const struct options *opt) { fprintf(stderr, _("Usage: %s\n"), usage); - fputc('\n', stderr); + if (opt->type != OPTION_GROUP) + fputc('\n', stderr); for (; opt->type != OPTION_END; opt++) { size_t pos; int pad; + if (opt->type == OPTION_GROUP) + { + fputc('\n', stderr); + if (*opt->help) + fprintf(stderr, "%s\n", opt->help); + continue; + } + pos = fprintf(stderr, " "); if (opt->short_name) pos += fprintf(stderr, "-%c", opt->short_name); @@ -111,6 +120,7 @@ unsigned parse_opts(int argc, char **argv, const struct options *opt, if (opt[ii].short_name) strbuf_append_strf(shortopts, "%c::", opt[ii].short_name); break; + case OPTION_GROUP: case OPTION_END: break; } @@ -179,6 +189,7 @@ unsigned parse_opts(int argc, char **argv, const struct options *opt, case OPTION_LIST: *(GList**)(opt[ii].value) = g_list_append(*(GList**)(opt[ii].value), optarg); break; + case OPTION_GROUP: case OPTION_END: break; } diff --git a/src/lib/parse_options.h b/src/lib/parse_options.h index 82f3c6b8..8c784b96 100644 --- a/src/lib/parse_options.h +++ b/src/lib/parse_options.h @@ -25,6 +25,7 @@ extern "C" { enum parse_opt_type { OPTION_BOOL, + OPTION_GROUP, OPTION_STRING, OPTION_INTEGER, OPTION_OPTSTRING, @@ -50,6 +51,7 @@ struct options { */ #define OPT_END() { OPTION_END } #define OPT_BOOL(s, l, v, h) { OPTION_BOOL, (s), (l), (v), NULL, (h) } +#define OPT_GROUP(h) { OPTION_GROUP, 0, NULL, NULL, NULL, (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) } diff --git a/src/plugins/Makefile.am b/src/plugins/Makefile.am index 207fc860..3a39247b 100644 --- a/src/plugins/Makefile.am +++ b/src/plugins/Makefile.am @@ -296,9 +296,11 @@ abrt_action_install_debuginfo_LDADD = abrt_retrace_client_SOURCES = \ abrt-retrace-client.c abrt_retrace_client_CFLAGS = \ + -I$(srcdir)/../include/report \ -I$(srcdir)/../include \ -I$(srcdir)/../lib \ $(NSS_CFLAGS) \ + $(GLIB_CFLAGS) \ -D_GNU_SOURCE \ -Wall -Werror abrt_retrace_client_LDADD = \ |