Re: Microproject idea: new OPT_* macros for PARSE_OPT_NONEG
- From
Duy Nguyen <pclouds@gmail.com>
- Date
- Mar 12, 2014, 23:37 UTC
- Message-ID
- <CACsJy8Dw=43m_4KzAxwCqLsFq2E23rT=bT3zmGUue6RYTnrOYg@mail.gmail.com>
- In-Reply-To
- <xmqqzjl1u87n.fsf@gitster.dls.corp.google.com>
On Sat, Mar 8, 2014 at 2:20 AM, Junio C Hamano <gitster@pobox.com> wrote:
Show 6 quoted lines
> Looking at "git grep -B3 OPT_NONEG" output, it seems that NONEG is > associated mostly with OPTION_CALLBACK and OPTION_SET_INT in the > existing code. > > Perhaps OPT_SET_INT should default to not just OPT_NOARG but also > OPT_NONEG?
There are OPT_SET_INT() that should not have NONEG in current code. So there are two sets of SET_INT anyway. Either we convert them all to a new macro that takes an extra flag, or we add OPT_SET_INT_NONEG() that covers one set and leave the other set alone.
Show 5 quoted lines
> I have a suspition that most users of other OPT_SET_<TYPE> > short-hands may also want them to default to NONEG (and the rare > ones that want to allow "--no-value-of-this-type=Heh" for some > reason to use the fully spelled form). IIRC NONEG is relatively a > new addition, and many existing OPT_STRING() may predate it.
I haven't checked how NONEG affects other types. But that's something I should probably look into.
-- Duy