parse-options: stop abusing 'callback' for lowlevel callbacks

Lowlevel callbacks have different function signatures. Add a new field
in 'struct option' with the right type for lowlevel callbacks.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Nguyễn Thái Ngọc Duy
2019-01-27 07:35:26 +07:00
committed by Junio C Hamano
parent f62470c650
commit bf3ff338a2
6 changed files with 32 additions and 13 deletions

View File

@ -170,7 +170,8 @@ int parse_opt_noop_cb(const struct option *opt, const char *arg, int unset)
* "-h" output even if it's not being handled directly by
* parse_options().
*/
int parse_opt_unknown_cb(const struct option *opt, const char *arg, int unset)
int parse_opt_unknown_cb(struct parse_opt_ctx_t *ctx,
const struct option *opt, int unset)
{
return -2;
}