From: Sven Wischnowsky <wischnow@informatik.hu-berlin.de>
To: zsh-workers@sunsite.auc.dk
Subject: Re: zparseopts change (Re: PATCH: Re: _netscape)
Date: Tue, 23 May 2000 16:57:44 +0200 (MET DST) [thread overview]
Message-ID: <200005231457.QAA29305@beta.informatik.hu-berlin.de> (raw)
In-Reply-To: "Bart Schaefer"'s message of Tue, 23 May 2000 14:43:10 +0000
Bart Schaefer wrote:
> On May 23, 3:15pm, Sven Wischnowsky wrote:
> } Subject: Re: PATCH: Re: _netscape
> }
> } +The tt(-E) option allows to extract the options described by the
> } +var(specs) from the positional parameters, ignoring all other strings.
>
> Could you make that just a little bit more verbose, please? What does
> "extract" mean? How does "ignoring" affect the parsing? E.g.,
Hmhm. I can't do much better than this...
Bye
Sven
Index: Doc/Zsh/mod_zutil.yo
===================================================================
RCS file: /cvsroot/zsh/zsh/Doc/Zsh/mod_zutil.yo,v
retrieving revision 1.7
diff -u -r1.7 mod_zutil.yo
--- Doc/Zsh/mod_zutil.yo 2000/05/23 13:18:36 1.7
+++ Doc/Zsh/mod_zutil.yo 2000/05/23 14:58:04
@@ -156,6 +156,11 @@
characters can appear in the option name provided it is preceded by a
backslash.
+Unless the tt(-E) option is given, parsing stops at the first string
+that isn't described by one of the var(specs) And even with tt(-E),
+parsing always stops at a positional parameter equal to `tt(-)' or
+`tt(-)tt(-)'.
+
If the tt(-A) option is given, the options and their values will also
be put into an associative array with the option names as keys and the
arguments (if any) as the values. Note that it is an error to give
@@ -167,8 +172,10 @@
var(specs). This means that any options processed by tt(zparseopts) are
removed from the positional parameters.
-The tt(-E) option allows to extract the options described by the
-var(specs) from the positional parameters, ignoring all other strings.
+Since tt(-E) changes the parsing rules, it can be used to test for or
+(if used together with tt(-D)) extract options and their arguments,
+ignoring all other options and arguments that may be in the positional
+parameters.
For example,
@@ -181,5 +188,18 @@
bar=(-b x -c y -c z))
The arguments from `tt(baz)' on will not be used.
+
+As an example for the tt(-E) option, consider:
+
+example(set -- -a x -b y -c z arg1 arg2
+zparseopts -E -D b:=bar)
+
+will have the effect of
+
+example(bar=(-b y)
+set -- -a x -c z arg1 arg2)
+
+I.e., the option tt(-b) and its arguments are taken from the
+positional parameters and put into the array tt(bar).
)
enditem()
--
Sven Wischnowsky wischnow@informatik.hu-berlin.de
next reply other threads:[~2000-05-23 14:59 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2000-05-23 14:57 Sven Wischnowsky [this message]
-- strict thread matches above, loose matches on Subject: below --
2000-05-23 13:15 PATCH: Re: _netscape Sven Wischnowsky
2000-05-23 14:43 ` zparseopts change (Re: PATCH: Re: _netscape) Bart Schaefer
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=200005231457.QAA29305@beta.informatik.hu-berlin.de \
--to=wischnow@informatik.hu-berlin.de \
--cc=zsh-workers@sunsite.auc.dk \
/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.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
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).