diff options
Diffstat (limited to 'parse-options.c')
| -rw-r--r-- | parse-options.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/parse-options.c b/parse-options.c index acc3a93660..cb24f1aa8a 100644 --- a/parse-options.c +++ b/parse-options.c @@ -288,6 +288,8 @@ again: optname(options, flags)); if (*rest) continue; + if (options->value) + *(int *)options->value = options->defval; p->out[p->cpidx++] = arg - 2; return PARSE_OPT_DONE; } @@ -529,8 +531,7 @@ static void show_negated_gitcomp(const struct option *opts, int nr_noopts) } } -static int show_gitcomp(struct parse_opt_ctx_t *ctx, - const struct option *opts) +static int show_gitcomp(const struct option *opts) { const struct option *original_opts = opts; int nr_noopts = 0; @@ -609,7 +610,7 @@ int parse_options_step(struct parse_opt_ctx_t *ctx, /* lone --git-completion-helper is asked by git-completion.bash */ if (ctx->total == 1 && !strcmp(arg + 1, "-git-completion-helper")) - return show_gitcomp(ctx, options); + return show_gitcomp(options); if (arg[1] != '-') { ctx->opt = arg + 1; |
