Subject: Re: [PATCH 01/10] parse-options: Don't call parse_options_check() so much

From: René Scharfe <[email-masked]>
Date: Sun, 05 Dec 2010 19:14:43 +0100

Am 02.12.2010 00:28, schrieb Jonathan Nieder:
> From: Stephen Boyd <[email-masked]>
> 
> parse_options_check() is being called for each invocation of
> parse_options_step() which can be quite a bit for some commands. The
> commit introducing this function cb9d398 (parse-options: add
> parse_options_check to validate option specs., 2009-06-09) had the
> correct motivation and explicitly states that parse_options_check()
> should be called from parse_options_start(). However, the implementation
> differs from the motivation. Fix it.

Good idea.

>  void parse_options_start(struct parse_opt_ctx_t *ctx,
>  			 int argc, const char **argv, const char *prefix,
> -			 int flags)
> +			 int flags, const struct option *options)

It might be better to put options before flags, i.e. to use the same
order as in parse_options().

René