From ce2412aae33a1334689a0ed3cee61c68cfcd515c Mon Sep 17 00:00:00 2001 From: kevin Date: Mon, 20 Jul 2020 17:43:54 -0400 Subject: [PATCH] cmPgmOpts.c : Fix bug where 'flag' type was always reported as 'required'. --- cmPgmOpts.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/cmPgmOpts.c b/cmPgmOpts.c index a0716bf..be0de7c 100644 --- a/cmPgmOpts.c +++ b/cmPgmOpts.c @@ -722,7 +722,10 @@ cmPoRC_t cmPgmOptParse( cmPgmOptH_t h, unsigned argCnt, char* argArray[] ) cmPgmOptInstallBool(h, kVersionPoId, 'v', "version", 0, false, NULL,0,"Print version information." ); if( _cmPgmOptNumIdToOptRecd(p,kPrintParmsPoId) == NULL ) - cmPgmOptInstallBool(h, kPrintParmsPoId,'p', "parms", 0, false, NULL,0,"Print the arguments."); + cmPgmOptInstallBool(h, kPrintParmsPoId,'p', "parms", 0, false, NULL,0,"Print the arguments."); + + if((rc = cmErrLastRC(&p->err)) != kOkPoRC ) + return rc; while(isflags & kTypeMaskPoFl,r->cflags); - if( cmIsNotFlag(r->sflags,kEnumPoFl) && cmIsFlag(r->sflags,kReqPoFl) ) + if( cmIsNotFlag(r->sflags,kEnumPoFl) && cmIsFlag(r->cflags,kReqPoFl) ) reqLabel = reqStr; if( mstr != NULL )