From e6ba33c6b498c62584fe5b23524c87eef7a6a711 Mon Sep 17 00:00:00 2001 From: ewt Date: Tue, 13 Oct 1998 14:52:13 +0000 Subject: [PATCH] used POPT_ARG_MASK CVS patchset: 2455 CVS date: 1998/10/13 14:52:13 --- popt/popthelp.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/popt/popthelp.c b/popt/popthelp.c index 101ecc7..5b46105 100644 --- a/popt/popthelp.c +++ b/popt/popthelp.c @@ -79,7 +79,7 @@ static int maxArgWidth(const struct poptOption * opt) { int this; while (opt->longName || opt->shortName || opt->arg) { - if (opt->argInfo == POPT_ARG_INCLUDE_TABLE) { + if ((opt->argInfo & POPT_ARG_MASK) == POPT_ARG_INCLUDE_TABLE) { this = maxArgWidth(opt->arg); } else { this = opt->shortName ? 2 : 0; @@ -113,7 +113,7 @@ static void singleTableHelp(FILE * f, const struct poptOption * table, opt = table; while (opt->longName || opt->shortName || opt->arg) { - if (opt->argInfo == POPT_ARG_INCLUDE_TABLE) { + if ((opt->argInfo & POPT_ARG_MASK) == POPT_ARG_INCLUDE_TABLE) { if (opt->descrip) fprintf(f, "\n%s\n", opt->descrip); singleTableHelp(f, opt->arg, left); @@ -157,7 +157,8 @@ static int singleOptionUsage(FILE * f, int cursor, const char * item = shortStr; if (opt->shortName) { - if (!opt->argInfo) return cursor; /* we did these already */ + if (!(opt->argInfo & POPT_ARG_MASK)) + return cursor; /* we did these already */ len++; *shortStr = opt->shortName; shortStr[1] = '\0'; @@ -190,7 +191,7 @@ int singleTableUsage(FILE * f, int cursor, const struct poptOption * table) { while (opt->longName || opt->shortName || opt->arg) { if (opt->longName || opt->shortName) cursor = singleOptionUsage(f, cursor, opt); - else if (opt->argInfo == POPT_ARG_INCLUDE_TABLE) + else if ((opt->argInfo & POPT_ARG_MASK) == POPT_ARG_INCLUDE_TABLE) cursor = singleTableUsage(f, cursor, opt->arg); opt++; } @@ -209,9 +210,9 @@ static int showShortOptions(const struct poptOption * opt, FILE * f, } while (opt->longName || opt->shortName || opt->arg) { - if (opt->shortName && !opt->argInfo) + if (opt->shortName && !(opt->argInfo & POPT_ARG_MASK)) str[strlen(str)] = opt->shortName; - else if (opt->argInfo == POPT_ARG_INCLUDE_TABLE) + else if ((opt->argInfo & POPT_ARG_MASK) == POPT_ARG_INCLUDE_TABLE) showShortOptions(opt->arg, f, str); opt++; -- 2.7.4