From: Jeff King Date: Tue, 15 Sep 2020 15:27:30 GMT Subject: Re: sub-fetches discard --ipv4|6 option Message-ID: <20200915152730.GA2853972@coredump.intra.peff.net> In-Reply-To: <20200915140613.GB18984@pflmari> On Tue, Sep 15, 2020 at 04:06:13PM +0200, Alex Riesen wrote: > > Yeah, that would solve the duplication problem. We could probably add a > > "recursive" bit to the parse-options flag variable. Even if > > parse-options itself doesn't use it, it could be a convenience for > > callers like this one. It is a little inconvenient to set flags there, > > just because it usually means ditching our wrapper macros in favor of a > > raw struct declaration. > > Or extend the list of wrappers with _REC(URSIVE) macros If you go that route, we have some "_F" macros that take flags. Probably would make sense to add it more consistently, which lets you convert: OPT_BOOL('f', "foo", &foo, "the foo option"); into: OPT_BOOL_F('f', "foo", &foo, "the foo option", PARSE_OPT_RECURSIVE); but could also be used for other flags. -Peff