zsh-workers
 help / color / mirror / code / Atom feed
* zsh-4.2.1: Bug in zparseopts ?
@ 2004-08-17 11:18 Dieter Lambrecht
  2004-08-17 21:58 ` Bart Schaefer
  0 siblings, 1 reply; 2+ messages in thread
From: Dieter Lambrecht @ 2004-08-17 11:18 UTC (permalink / raw)
  To: zsh-workers

Hi,

script

#! /bin/zsh

emulate -L zsh

set -- -c 1
echo "New set:" $@
zparseopts -a args -A Args 'c:'
echo "c:" ${args[@]} "|" ${(kv)Args[@]}

echo "***********"
set -- --c 2
echo "New set:" $@

zparseopts -E -a args -A Args '--c+:'
echo "--c:" ${args[@]} "|" ${(kv)Args[@]}

zparseopts -E -a args -A args '\-c+:'
echo "\-c:" ${args[@]} "|" ${(kv)Args[@]}

zparseopts -E -a args -A args '-c+:'
echo "\-c:" ${args[@]} "|" ${(kv)Args[@]}


gives the following output:


New set: -c 1
c: -c 1 | -c 1
***********
New set: --c 2
--c: |
\-c: |
./t5.sh:zparseopts:20: missing option descriptions
\-c: |




"The Z Shell manual" p. 213 states that name='-files' should recognise GNU long options like "--files". However, I could not parse these options whith zparseopts.



Kind Regards,

Dieter Lambrecht




--

Diese E-Mail enthält vertrauliche und/oder rechtlich geschützte Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtümlich erhalten haben, informieren Sie bitte sofort den Absender und vernichten Sie diese Mail. Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser Mail ist nicht gestattet.

This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden.



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: zsh-4.2.1: Bug in zparseopts ?
  2004-08-17 11:18 zsh-4.2.1: Bug in zparseopts ? Dieter Lambrecht
@ 2004-08-17 21:58 ` Bart Schaefer
  0 siblings, 0 replies; 2+ messages in thread
From: Bart Schaefer @ 2004-08-17 21:58 UTC (permalink / raw)
  To: zsh-workers

On Tue, 17 Aug 2004, Dieter Lambrecht wrote:

> set -- --c 2
> 
> zparseopts -E -a args -A args '-c+:'

Try:

    zparseopts -E -a args -A args -- '-c+:'

It's not exactly obvious from the documentation, but you must use "--"
to signal the end of the options of zparseopts and the beginning of the
descriptions of the options it should parse.  (Or list at least one
description that does not begin with a "-" before listing any that do.)


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2004-08-17 22:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-08-17 11:18 zsh-4.2.1: Bug in zparseopts ? Dieter Lambrecht
2004-08-17 21:58 ` Bart Schaefer

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).