From: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
To: Pierre Habouzit <madcoder@debian.org>
Cc: gitster@pobox.com, git@vger.kernel.org
Subject: Re: [PATCH 01/10] Add a parseopt mode to git-rev-parse to bring parse-options to shell scripts.
Date: Sun, 4 Nov 2007 12:29:31 +0100 [thread overview]
Message-ID: <20071104112931.GB2119@ins.uni-bonn.de> (raw)
In-Reply-To: <1194172262-1563-2-git-send-email-madcoder@debian.org>
Hello Pierre,
A couple of language nits:
* Pierre Habouzit wrote on Sun, Nov 04, 2007 at 11:30:53AM CET:
> +PARSEOPT
> +--------
> +
> +In `--parseopt` mode, `git-rev-parse` helps massaging options to bring to shell
> +scripts the same facilities C builtins have. It works as an option normalizer
> +(e.g. splits single switches aggregate values), a bit like `getopt(1)` does.
> +
> +It takes on the standard input the specification of the options to parse and
> +understand, and echoes on the standard ouput a line suitable for `sh(1)` `eval`
> +to replace the arguments with normalized ones. In case of error, it ouputs
s/ouputs/outputs/
> +usage on the standard error stream, and exits with code 129.
> +
> +Input Format
> +~~~~~~~~~~~~
> +
> +`git-ref-parse --parseopt` input format is fully text based. It has two parts,
s/^/The /
s/git-ref-parse/git-rev-parse/
> +separated by a line that contains only `--`. The lines before (should be more
> +than one) are used for the usage. The lines after describe the options.
I would write
s/before/& the `--`/
s/after/& the `--`/
or maybe write "separator" instead of `--`.
[...]
> +`<opt_spec>`::
> + its format is the short option character, then the long option name
> + separated by a comma. Both parts are not required, though at least one
> + is necessary. `h,help`, `dry-run` and `f` are all three correct
> + `<opt_spec>`.
> +
> +`<arg_spec>`::
> + an `<arg_spec>` tells the option parser if the option has an argument
> + (`=`), an optionnal one (`?` though its use is discouraged) or none
s/optionnal/optional/
> + (no `<arg_spec>` in that case).
> +
> +The rest of the line after as many spaces up to the ending line feed is used
> +as the help associated to the option.
I'd write (in case that is technically correct):
After following white space, the rest of the line after is used as the
help associated to the option.
> +Blank lines are ignored, and lines that don't match this specification are used
> +as option group headers (start the line with a space to purposely create such
> +lines).
I'd write:
... to create such lines on purpose.
> +Example
> +~~~~~~~
> +
> +------------
> +OPTS_SPEC="\
> +some-command [options] <args>...
> +
> +some-command does foo and bar !
Please no white space before "!".
> +--
> +h,help show the help
> +
> +foo some nifty option --foo
> +bar= some cool option --bar with an argument
> +
> + An option group Header
> +C? option C with an optionnal argument"
s/optionnal/optional/
Cheers,
Ralf
next prev parent reply other threads:[~2007-11-04 11:29 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-11-04 10:30 ph/parseopt-sh reloaded Pierre Habouzit
2007-11-04 10:30 ` [PATCH 01/10] Add a parseopt mode to git-rev-parse to bring parse-options to shell scripts Pierre Habouzit
2007-11-04 10:30 ` [PATCH 02/10] Update git-sh-setup(1) to allow transparent use of git-rev-parse --parseopt Pierre Habouzit
2007-11-04 10:30 ` [PATCH 03/10] Migrate git-clean.sh to use " Pierre Habouzit
2007-11-04 10:30 ` [PATCH 04/10] Migrate git-clone " Pierre Habouzit
2007-11-04 10:30 ` [PATCH 05/10] Migrate git-am.sh " Pierre Habouzit
2007-11-04 10:30 ` [PATCH 06/10] Migrate git-merge.sh " Pierre Habouzit
2007-11-04 10:30 ` [PATCH 07/10] Migrate git-instaweb.sh " Pierre Habouzit
2007-11-04 10:31 ` [PATCH 08/10] Migrate git-checkout.sh to use git-rev-parse --parseopt --keep-dashdash Pierre Habouzit
2007-11-04 10:31 ` [PATCH 09/10] Migrate git-quiltimport.sh to use git-rev-parse --parseopt Pierre Habouzit
2007-11-04 10:31 ` [PATCH 10/10] Migrate git-repack.sh " Pierre Habouzit
2007-11-04 14:49 ` [PATCH 04/10] Migrate git-clone " Pierre Habouzit
2007-11-06 19:04 ` Nicolas Pitre
2007-11-06 19:32 ` Junio C Hamano
2007-11-06 19:44 ` Nicolas Pitre
2007-11-06 19:39 ` Junio C Hamano
2007-11-04 11:29 ` Ralf Wildenhues [this message]
2007-11-04 11:31 ` [PATCH 01/10] Add a parseopt mode to git-rev-parse to bring parse-options to shell scripts Ralf Wildenhues
2007-11-04 22:58 ` Junio C Hamano
2007-11-04 23:14 ` Pierre Habouzit
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=20071104112931.GB2119@ins.uni-bonn.de \
--to=ralf.wildenhues@gmx.de \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=madcoder@debian.org \
/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).