Honor `GARGOYLE_FLG_STRCT` when parsing command line arguments

This commit is contained in:
Nick Chambers 2022-06-29 23:32:07 -05:00
parent a804676055
commit 60b54e37c0
1 changed files with 14 additions and 2 deletions

View File

@ -32,7 +32,13 @@ uint8_t gargoyle_digest_argv(uint16_t optc, struct gargoyle_opt *optv, int *argc
opt = gargoyle_find_brand(optc, optv, brand, "no-", 3, flags);
if(!opt) {
return GARGOYLE_ERR_UNKNOWN_OPT;
if(flags & GARGOYLE_FLG_STRCT) {
return GARGOYLE_ERR_UNKNOWN_OPT;
} else {
*argc -= 1;
*argv += 1;
continue;
}
}
uint8_t res = 0;
@ -61,7 +67,13 @@ uint8_t gargoyle_digest_argv(uint16_t optc, struct gargoyle_opt *optv, int *argc
opt = gargoyle_find_emblem(optc, optv, *idx, flags);
if(!opt) {
return GARGOYLE_ERR_UNKNOWN_OPT;
if(flags & GARGOYLE_FLG_STRCT) {
return GARGOYLE_ERR_UNKNOWN_OPT;
} else {
*argc -= 1;
*argv += 1;
continue;
}
}
uint8_t res = 0;