cmPgmOpts.c : Fix bug where 'flag' type was always reported as 'required'.

This commit is contained in:
kevin 2020-07-20 17:43:54 -04:00
parent e9e405f4a9
commit ce2412aae3

View File

@ -724,6 +724,9 @@ cmPoRC_t cmPgmOptParse( cmPgmOptH_t h, unsigned argCnt, char* argArray[] )
if( _cmPgmOptNumIdToOptRecd(p,kPrintParmsPoId) == NULL ) 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(i<argCnt) while(i<argCnt)
{ {
@ -1247,7 +1250,7 @@ void cmPgmOptPrintHelp( cmPgmOptH_t h, cmRpt_t* rpt )
if( _cmPoOptUsesValue(r) ) if( _cmPoOptUsesValue(r) )
valueTypeLabel = _cmPoTypeFlagToLabel(r->sflags & kTypeMaskPoFl,r->cflags); valueTypeLabel = _cmPoTypeFlagToLabel(r->sflags & kTypeMaskPoFl,r->cflags);
if( cmIsNotFlag(r->sflags,kEnumPoFl) && cmIsFlag(r->sflags,kReqPoFl) ) if( cmIsNotFlag(r->sflags,kEnumPoFl) && cmIsFlag(r->cflags,kReqPoFl) )
reqLabel = reqStr; reqLabel = reqStr;
if( mstr != NULL ) if( mstr != NULL )