Re: [PATCH v3 1/3] pretty.c: rework describe options parsing for better extensibility
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Oct 29, 2021, 20:11 UTC
- Message-ID
- <xmqq35ojlhg6.fsf@gitster.g>
- In-Reply-To
- <20211029184512.1568017-2-eschwartz@archlinux.org>
Eli Schwartz <eschwartz@archlinux.org> writes:
Show 7 quoted lines
> + struct {
> + char *name;
> + enum { OPT_STRING } type;
> + } option[] = {
> + { "exclude", OPT_STRING },
> + { "match", OPT_STRING },
> + };I floated OPT_<TYPE> in my earlier illustration as "something like this", not "literally use these tokens". We have CPP macros of the same name in parse-options.h API---we may not see troubles from the name clashes today, but let's not leave it to chances.
Perhaps call it like DESCRBE_ARG_STRING or something that ensures uniqueness like that?
Thanks.