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

Re: [PATCH/RFC] gitopt - command-line parsing enhancements

From
EWEric Wong <normalperson@yhbt.net>
Date
May 9, 2006, 19:48 UTC
Message-ID
<20060509194825.GC3676@localdomain>
In-Reply-To
<7vzmhr7fys.fsf@assigned-by-dhcp.cox.net>
Junio C Hamano <junkio@cox.net> wrote:
Show 10 quoted lines
> Eric Wong <normalperson@yhbt.net> writes:
> 
> > Here's my take at a new command-line option parser to reduce wear on my
> > fingers.  It handles both long and short options, permuting, automatic
> > abbreviations, required arguments, optional arguments, and bundling.
> 
> Taken a superficial look at it.
> 
> Sounds nice, might be a tad too ambitious though.  Looks
> intrusive at places.

I wasn't overly happy with the addition of global variables to existing files and the way they're set (setup_revisions). But at least they're static. Of course, I'm not yet certain that I haven't introduced new bugs. All the tests pass, at least...

> And scary, especially the "eat" macros are very scary.

They look weird at first, but I think they help readability and maintainability once you get used to them. They let you focus on the important part of the function while hiding the boring parts from you. Quite elegant, imho.

-- 
Eric Wong
Previous: Junio C HamanoNext: Junio C Hamano
Message 3 of 5 in “gitopt - command-line parsing enhancements”
  1. gitopt - command-line parsing enhancementsEric Wong, May 9, 2006
  2. Junio C HamanoMay 9, 2006
  3. Eric WongMay 9, 2006
  4. Junio C HamanoMay 9, 2006
  5. Eric WongMay 9, 2006

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.