Re: [PATCH v3 1/8] parseopt: extract subcommand handling from parse_options_step()
- From
- Jiamu Sun <39@barroit.sh>
- Date
- Mar 11, 2026, 01:49 UTC
- Message-ID
- <SY0P300MB0801AE08F2AE4C0EAA274A68CE47A@SY0P300MB0801.AUSP300.PROD.OUTLOOK.COM>
- In-Reply-To
- <CAOLa=ZQ3eCky2rH_D-6=vwQ26TKW_dSO84+Z-WL2LFJ2rGVmqQ@mail.gmail.com>
On Tue, Mar 10, 2026 at 05:46:12AM -0700, Karthik Nayak wrote:
Show 7 quoted lines
> > + if (ctx->has_subcommands) {
> > + return handle_subcommand(ctx, arg, options,
> > + usagestr);
> > }
> > +
>
> Nit: we try to avoid braces around single statement blocks.I'm not sure if we should drop the braces in this case. I mean, the statement is indeed a single one, but it spans multiple lines. Keeping the braces improves readability. Also, CodingGuidelines says: "When the statement extends over a few lines" use braces. So I think we should keep those braces?
--
Jiamu Sun <39@barroit.sh>
<sunjiamu@outlook.com>