From: René Scharfe Date: Sun, 05 Dec 2010 18:14:43 GMT Subject: Re: [PATCH 01/10] parse-options: Don't call parse_options_check() so much Message-ID: <4CFBD693.20305@lsrfire.ath.cx> In-Reply-To: <20101201232852.GB31815@burratino> Am 02.12.2010 00:28, schrieb Jonathan Nieder: > From: Stephen Boyd > > 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é