From: Christian Couder Date: Mon, 02 Nov 2026 15:20:31 GMT Subject: Re: [PATCH v3 2/4] parse-options: extract lookup_long_opt() from parse_long_opt() Message-ID: In-Reply-To: <02ba1b9d-b598-454b-897f-cb33ba190b13@gmail.com> On Fri, Oct 30, 2026 at 10:09 PM Kaartic Sivaraam wrote: > > On 10/12/26 13:14, Christian Couder wrote: > > +static enum parse_opt_result parse_long_opt(struct parse_opt_ctx_t *p, > > + const char *arg, > > + const struct option *options) > > +{ > > + struct parsed_option found; > > + struct parsed_option other; > > + const char *stuck; > > + enum long_opt_lookup result = lookup_long_opt(p, arg, options, > > + &found, &other, &stuck); > > + > > Would it not be better to consume the `enum long_op_lookup` return value > via a switch rather than having a set of if statements to cover all the > cases? Yeah, it might be a bit better with a switch, so the v4 I just sent uses a switch. Thanks.