From 3380e13c62e1b7a8309423f4eccfb4b6cbaa0310 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Thu, 20 Jan 2011 20:39:22 +0100 Subject: Remove unused OPTION_GROUP Signed-off-by: Denys Vlasenko --- src/lib/parse_options.c | 13 +------------ src/lib/parse_options.h | 2 -- 2 files changed, 1 insertion(+), 14 deletions(-) (limited to 'src/lib') diff --git a/src/lib/parse_options.c b/src/lib/parse_options.c index 6f022551..bcec7869 100644 --- a/src/lib/parse_options.c +++ b/src/lib/parse_options.c @@ -28,22 +28,13 @@ void show_usage_and_die(const char *usage, const struct options *opt) { fprintf(stderr, _("Usage: %s\n"), usage); - if (opt->type != OPTION_GROUP) - fputc('\n', stderr); + 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); @@ -119,7 +110,6 @@ 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; } @@ -185,7 +175,6 @@ unsigned parse_opts(int argc, char **argv, const struct options *opt, if (optarg) *(char**)opt[ii].value = (char*)optarg; break; - case OPTION_GROUP: case OPTION_END: break; } diff --git a/src/lib/parse_options.h b/src/lib/parse_options.h index 55ca0e2d..05d6fd90 100644 --- a/src/lib/parse_options.h +++ b/src/lib/parse_options.h @@ -25,7 +25,6 @@ extern "C" { enum parse_opt_type { OPTION_BOOL, - OPTION_GROUP, OPTION_STRING, OPTION_INTEGER, OPTION_OPTSTRING, @@ -50,7 +49,6 @@ 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), "n", (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) } -- cgit