Re: [PATCH 3/3] parse-options: remove PARSE_OPT_NEGHELP
From: Junio C Hamano <hidden>
Date: 2016-06-15 22:53:09
Jeff King [off-list ref] writes:
... Would it be
better to simply be explicit that an option is a reversed boolean (i.e.,
what the user specifies on the command line and what is in the code are
naturally opposites). Like:
OPT_REVERSE_BOOL(0, "no-index", &use_index,
"finds in contents not managed by git"),You said it much better than my attempt ;-).
Using NEGHELP, the "reverse" is between the option name and the description, which is very subtle. Here it is between the option name and the variable, which is hopefully a little more explicit (especially with the big REVERSE in the macro name). I dunno. Given that there are only two uses of NEGHELP, and that they don't come out too badly, I don't care _too_ much. But I have seen some really tortured logic with double-negations like this, and I'm concerned that a few months down the road somebody is going to want NEGHELP (or something similar) in a case where it actually does really impact readability.
Yeah, I share a similar minor and iffy feeling about the result.