git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Microproject idea: new OPT_* macros for PARSE_OPT_NONEG

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 13, 2014, 19:00 UTC
Message-ID
<xmqqfvmlj54n.fsf@gitster.dls.corp.google.com>
In-Reply-To
<CACsJy8Dw=43m_4KzAxwCqLsFq2E23rT=bT3zmGUue6RYTnrOYg@mail.gmail.com>
Duy Nguyen <pclouds@gmail.com> writes:
Show 12 quoted lines
> On Sat, Mar 8, 2014 at 2:20 AM, Junio C Hamano <gitster@pobox.com> wrote:
>> 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.

Are you forgetting the third alternative, of swapping the default, if the ones that do not want NONEG are in the minority, to reduce the number of spelled-out instances?

Previous: Duy NguyenNext: Duy Nguyen
Message 6 of 7 in “Microproject idea: new OPT_* macros for PARSE_OPT_NONEG”
  1. Duy NguyenMar 7, 2014
  2. Michael HaggertyMar 7, 2014
  3. Duy NguyenMar 7, 2014
  4. Junio C HamanoMar 7, 2014
  5. Duy NguyenMar 12, 2014
  6. Junio C HamanoMar 13, 2014
  7. Duy NguyenMar 13, 2014

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.