Re: [PATCH v3 2/4] parse-options: extract lookup_long_opt() from parse_long_opt()
- From
Christian Couder <christian.couder@gmail.com>
- Date
- Nov 2, 2026, 15:20 UTC
- Message-ID
- <CAP8UFD2DN=fYVnj+oxUfN0qX4ur3JySngHXs0rv-fEPsMKOb7g@mail.gmail.com>
- In-Reply-To
- <02ba1b9d-b598-454b-897f-cb33ba190b13@gmail.com>
On Fri, Oct 30, 2026 at 10:09 PM Kaartic Sivaraam <kaartic.sivaraam@gmail.com> wrote:
> > On 10/12/26 13:14, Christian Couder wrote:
Show 14 quoted lines
> > +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.