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

Re: [PATCH 2/3] parse-options: add PARSE_OPT_CUSTOM_ARGH for complicated argh's

From
Junio C Hamano <gitster@pobox.com>
Date
May 18, 2009, 06:14 UTC
Message-ID
<7vd4a7ey4h.fsf@alter.siamese.dyndns.org>
In-Reply-To
<1242557224-8411-2-git-send-email-bebarino@gmail.com>
Stephen Boyd <bebarino@gmail.com> writes:
> If argh is complicated, i.e. the option takes more than one argument,
> don't add the brackets around argh in the usage message.
I think later user wants a bit more descriptive explanation, like...
	Usually, argh element in struct option points at a placeholder
	value (e.g. "val"), and this is used to show
	    --option=<val>
	by enclosing the string inside of angle brackets.
	When the option takes something more complex (e.g. optional part
	separated by comma), you would want to produce a help that looks
	like
	    --option=<val1>[,<val2>]
	In such a case, the caller can pass a string to argh with
	placeholders already enclosed in necessary angle brackets
	(e.g. "<val1>[,<val2>]") and set this option.
Please update Documentation/technical/api-parse-options.txt as well.
Previous: Stephen BoydNext: Stephen Boyd
Message 4 of 9 in “show-branch: Fix die message in parse_reflog_param()”
  1. 1/3 show-branch: Fix die message in parse_reflog_param()Stephen Boyd, May 17, 2009
  2. 2/3 parse-options: add PARSE_OPT_CUSTOM_ARGH for complicated argh'sStephen Boyd, May 17, 2009
  3. 3/3 show-branch: migrate to parse-options APIStephen Boyd, May 17, 2009
  4. Junio C HamanoMay 18, 2009
  5. Stephen BoydMay 18, 2009
  6. Junio C HamanoMay 18, 2009
  7. Stephen BoydMay 18, 2009
  8. Jakub NarebskiMay 18, 2009
  9. Sverre RabbelierMay 19, 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.