git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Boyd <bebarino@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH 2/3] parse-options: add PARSE_OPT_CUSTOM_ARGH for complicated argh's
Date: Mon, 18 May 2009 00:08:27 -0700	[thread overview]
Message-ID: <4A11096B.8020208@gmail.com> (raw)
In-Reply-To: <7vd4a7ey4h.fsf@alter.siamese.dyndns.org>

Junio C Hamano wrote:
> 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.

This description sounds nice ;) Is PARSE_OPT_CUSTOM_ARGH a good name? I
was thinking maybe PARSE_OPT_MULTARGS is better?

> Please update Documentation/technical/api-parse-options.txt as well.

There's no documentation on the flags yet, but I suppose I could add that.

  reply	other threads:[~2009-05-18  7:08 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-17 10:47 [PATCH 1/3] show-branch: Fix die message in parse_reflog_param() Stephen Boyd
2009-05-17 10:47 ` [PATCH 2/3] parse-options: add PARSE_OPT_CUSTOM_ARGH for complicated argh's Stephen Boyd
2009-05-17 10:47   ` [PATCH 3/3] show-branch: migrate to parse-options API Stephen Boyd
2009-05-18  6:14   ` [PATCH 2/3] parse-options: add PARSE_OPT_CUSTOM_ARGH for complicated argh's Junio C Hamano
2009-05-18  7:08     ` Stephen Boyd [this message]
2009-05-18  7:57       ` Junio C Hamano
2009-05-18  8:06         ` Stephen Boyd
2009-05-18 22:52           ` Jakub Narebski
2009-05-19  5:09             ` Sverre Rabbelier
2009-05-21  7:33 ` [PATCHv2 1/2] parse-options: add PARSE_OPT_LITERAL_ARGHELP " Stephen Boyd
2009-05-21 16:26   ` Junio C Hamano
2009-05-21 16:51     ` René Scharfe
2009-05-21 19:03       ` Stephen Boyd
2009-05-21 21:27         ` Stephen Boyd
2009-05-21  7:33 ` [PATCHv2 2/2] show-branch: migrate to parse-options API Stephen Boyd

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4A11096B.8020208@gmail.com \
    --to=bebarino@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).