diff options
Diffstat (limited to 'parse-options.c')
-rw-r--r-- | parse-options.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/parse-options.c b/parse-options.c index e0c94b0546..d50962062e 100644 --- a/parse-options.c +++ b/parse-options.c @@ -929,13 +929,18 @@ enum parse_opt_result parse_options_step(struct parse_opt_ctx_t *ctx, continue; } - if (!arg[2] /* "--" */ || - !strcmp(arg + 2, "end-of-options")) { + if (!arg[2] /* "--" */) { if (!(ctx->flags & PARSE_OPT_KEEP_DASHDASH)) { ctx->argc--; ctx->argv++; } break; + } else if (!strcmp(arg + 2, "end-of-options")) { + if (!(ctx->flags & PARSE_OPT_KEEP_UNKNOWN_OPT)) { + ctx->argc--; + ctx->argv++; + } + break; } if (internal_help && !strcmp(arg + 2, "help-all")) |