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

Re: [PATCH] grep: use OPT_INTEGER_F for --max-depth

From
René Scharfe <l.s.r@web.de>
Date
Sep 7, 2023, 20:20 UTC
Message-ID
<724641d2-1cba-3768-6008-01e8a1cdca4e@web.de>
In-Reply-To
<20230905072122.GG199565@coredump.intra.peff.net>
Am 05.09.23 um 09:21 schrieb Jeff King:
Show 9 quoted lines
> On Sat, Sep 02, 2023 at 08:54:54PM +0200, René Scharfe wrote:
>
> In general, I wonder how many of the results from:
>
>   git grep '{ OPTION'
>
> could be converted to use the macros and end up more readable. There are
> a number of OPTARG ones, which I guess can't use macros. Looks like
> there are a handful of others (mostly for OPT_HIDDEN).

Indeed, and I have a semantic patch for that, but mostly because the macros allow injecting a type check.

OPTARG would need a new macro to allow specifying the default value. Or is there a variadic macro trick that we could use?

René
Previous: Jeff KingNext: Jeff King
Message 3 of 7 in “grep: use OPT_INTEGER_F for --max-depth”
  1. grep: use OPT_INTEGER_F for --max-depthRené Scharfe, Sep 2, 2023
  2. Jeff KingSep 5, 2023
  3. René ScharfeSep 7, 2023
  4. Jeff KingSep 7, 2023
  5. René ScharfeSep 8, 2023
  6. René ScharfeSep 9, 2023
  7. Jeff KingSep 12, 2023

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.