parse-options: make OPT_ARGUMENT() more useful
[gitweb.git] / parse-options.c
index cec74522e56b084fbb0c8eeec47456d0bb2f7d3e..1d57802da0e5da70cf00c2cf55b9f3945f44fe53 100644 (file)
@@ -286,6 +286,8 @@ static enum parse_opt_result parse_long_opt(
                                             optname(options, flags));
                        if (*rest)
                                continue;
+                       if (options->value)
+                               *(int *)options->value = options->defval;
                        p->out[p->cpidx++] = arg - 2;
                        return PARSE_OPT_DONE;
                }