Re: [PATCH v3 1/3] pretty.c: rework describe options parsing for better extensibility

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 10/29/21 4:11 PM, Junio C Hamano wrote:
> Eli Schwartz <eschwartz@xxxxxxxxxxxxx> writes:
> 
>> +	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?


Ah. That alternative seems a bit long though. :( Without breaking enum
type into one per line, it will quickly overflow line lengths... though
maybe it should be one per line anyway?

Will try to put some thought into naming.

-- 
Eli Schwartz
Arch Linux Bug Wrangler and Trusted User

Attachment: OpenPGP_signature
Description: OpenPGP digital signature


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux