Re: [PATCH v12 2/5] test-parse-options: print quiet as integer
- From
Duy Nguyen <pclouds@gmail.com>
- Date
- Apr 8, 2016, 11:33 UTC
- Message-ID
- <CACsJy8Bru3ZW_g2HA3yNt_yc6fV9DfWLY1BHWzVWWxxrtLp-9A@mail.gmail.com>
- In-Reply-To
- <CAFZEwPORAer3=WmUqqhztv4kAOHdv+yB12tRyUYh_YTSmtcQsQ@mail.gmail.com>
On Tue, Apr 5, 2016 at 10:39 PM, Pranit Bauva <pranit.bauva@gmail.com> wrote:
Show 24 quoted lines
> [+cc:Duy Nguyen, Jonathan Nieder] > > On Mon, Apr 4, 2016 at 3:00 AM, Eric Sunshine <sunshine@sunshineco.com> wrote: >> On Sat, Apr 2, 2016 at 7:33 PM, Pranit Bauva <pranit.bauva@gmail.com> wrote: >>> Current implementation of parse-options.c treats OPT__QUIET() as integer >>> and not boolean and thus it is more appropriate to print it as integer >>> to avoid confusion. >> >> I can buy this line of reasoning, however, it would be even easier to >> sell the change if you cited an existing client (a git command) which >> actually respects multiple quiet levels. Are there any? > > I investigated into this. But I was unable to find any git commit > which actually respects mulitple quiet levels. I first did a 'git grep > OPT__QUIET' to find the commands which use this. Then I went through > the documentation which covers it. None of them have any such mention > of multiple quiet levels. But still I dug further and and went through > all the individual source files. I followed the corresponding C source > code for the header file included and also searched there for any > trace of quiet. But I still didn't find any such use of multiple quiet > levels. I have found that the commit id 212c0a6f (Duy Ngyuyen; 7 Dec, > 2013; parse-options: remove OPT__BOOLEAN). Maybe he has something to > say as to why this was introduced and OPT__QUIET which previously used > OPT__BOOLEAN, now uses OPT_COUNTUP rather than OPT_BOOL.
I don't have much to say because my commit is a harmless conversion :) OPT_BOOLEAN _is_ OPT_COUNTUP with a misleading name, see b04ba2b (parse-options: deprecate OPT_BOOLEAN - 2011-09-27). If you dig further back, both OPT_VERBOSE and OPT_QUIET are introduced at the same time in 0ce865b (Add shortcuts for very often used options. - 2007-10-14) and they both are defined with OPT_BOOLEAN. I guess it was just an oversight that OPT_QUIET is defined as OPT_BOOLEAN instead of OPT_BOOL.
-- Duy