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

Re: [PATCH 2/3] config: set help text for --bool-or-int

From
Jeff King <peff@peff.net>
Date
Mar 7, 2009, 22:48 UTC
Message-ID
<20090307224807.GA18548@coredump.intra.peff.net>
In-Reply-To
<94a0d4530903071307p46092810rb1637bfc853ee4d1@mail.gmail.com>
On Sat, Mar 07, 2009 at 11:07:46PM +0200, Felipe Contreras wrote:
Show 9 quoted lines
> On Sat, Mar 7, 2009 at 7:14 PM, Jeff King <peff@peff.net> wrote:
> > The conversion to parse_opt left this as NULL; on glibc
> > systems, the usage message prints
> >
> >   --bool-or-int   (null)
> >
> > and on other ones, segfaults.
> 
> Shouldn't then OPT_BIT make sure there is no crash?

Perhaps, but it doesn't (and I assume you mean usage_with_help, as OPT_BIT is just filling in the struct). It's not clear what a NULL help parameter should do, though. Hide the option? Show no help description? There are already ways to accomplish both of those.

> I was surprised when it didn't complain. I thought on making it "" but
> I wanted to make it visible that there was no documentation for that,
> which is the reason I left it that way.
OK. I think there are really valid options:
  1. it's there with a description (which is what my patch does)
  2. it's there without a description, because it's obvious what it does
     coming after --bool and --int
  3. it's hidden
I really don't care which. But what is there now is broken.
-Peff
Previous: Felipe ContrerasNext: Felipe Contreras
Message 5 of 9 in “config --bool-or-int fixes”
  1. 0/3 config --bool-or-int fixesJeff King, Mar 7, 2009
  2. 1/3 t1300: use test_must_fail as appropriateJeff King, Mar 7, 2009
  3. 2/3 config: set help text for --bool-or-intJeff King, Mar 7, 2009
  4. Felipe ContrerasMar 7, 2009
  5. Jeff KingMar 7, 2009
  6. Felipe ContrerasMar 9, 2009
  7. Jeff KingMar 10, 2009
  8. 3/3 document config --bool-or-intJeff King, Mar 7, 2009
  9. Jeff KingMar 7, 2009

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.