Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Advanced option parsing across zsh commands
- X-seq: zsh-workers 37794
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: Zsh hackers list <zsh-workers@xxxxxxx>
- Subject: Re: Advanced option parsing across zsh commands
- Date: Tue, 26 Jan 2016 10:28:47 -0800
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=from:message-id:date:in-reply-to:comments:references:to:subject :mime-version:content-type; bh=6vqEFjhAHL1UEd2QF3kMiD5K9VF59SfOEZn5U1A9APw=; b=U8UaacQaLsdttEbHLygHUj4wqL8EmXQt2Bh8qTP7TaxJsIp1XXfwMsclroNT8B5qql Rt6S99tvx8bDRNHRdD5fy/wOVlULPkBUtpsPc9kOMRyazpRcCXVkKvhBqn+/7G7Wknqy g2+iOZDUNuzv05eScVmxzKZli/5o54GqBCa6Sm0nYjbKegZVvqxPA9t7IPf4ov90pl0B h8XNiJ1kvcELUBugnJQUGLko+Pkp49Y81N51iexDBRs34XYInUUdUKQMKb2ylWI+B2Ip MCBDrH1MGVof+Ck8ywMDEwB5bR4JxylsBwTr+QMolZvFGKHy2vDoEZUmhquoqUakLhtK zKtw==
- In-reply-to: <CAKc7PVAtu3Mvu2-rhqGiqqWZ34bOkP7mepPOoF-nZAejVUZoiA@mail.gmail.com>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <CAKc7PVAtu3Mvu2-rhqGiqqWZ34bOkP7mepPOoF-nZAejVUZoiA@mail.gmail.com>
On Jan 26, 10:20am, Sebastian Gniazdowski wrote:
} Subject: Advanced option parsing across zsh commands
}
} I like zparseopts because of -E option, which allows to mix options
} with strings and handles --. Is it expected that one day zsh will do
} the same?
No, this is not expected.
} % set -- a -b something -- -c
} % typeset -A opts
} % zparseopts -A opts -DE b: c
} % echo "${(kv)opts}"
}
} % # $1, $2, ... $5 are still the same
You can't stack the options of zparseopts itself, i.e, you can't use -DE,
you have to use -D -E.
zparseopts also doesn't handle "negated options" in the +X format, only
those introduced with "-". There's a fairly convoluted issue with making
"+" work for the associative array case because of the way zparseopts
gathers up the arguments of each option before assigning to the array.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author