Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Advanced option parsing across zsh commands
- X-seq: zsh-workers 37790
- From: Sebastian Gniazdowski <sgniazdowski@xxxxxxxxx>
- To: Zsh hackers list <zsh-workers@xxxxxxx>
- Subject: Advanced option parsing across zsh commands
- Date: Tue, 26 Jan 2016 10:20:49 +0100
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:from:date:message-id:subject:to:content-type; bh=o2NBlP36sjuXiQiVhydmsg8hKXNNtXPZD9GUrnqt1fA=; b=msfBB1OUVVWhWG0fPKGgcfLGQ4cf5JgiJmo+fMbZLl4GTFQWVYVX2poT4frZBmqqsJ OsJsh/nZ3/e4tRV7E5ZUxb+hTxTV9pnx4ETdZGJDrz8JEPo4wKSTSeuVEUVMTaGYGaFQ jQa7lkdzKshG3rBvhKf3/OKmYNOKthdsGUBQqtv7BMHKaEWY6IFERVRC99AbDfzZJSFK oDKZx7+d5L7U7cC4ogLNZrPVSS65ZRHtSx+8eISkircPJ2HAMdI0kl5V7aTFQRpdIOz/ cV8PTjMfmyWRDmlo7Un9+TQY6t4ndJUkpDRCvBdnIKZZ2t6zaKJzEwmgYoT7ixyslJL1 yUjg==
- 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
Hello,
This will bind to current keymap, not to "a":
% bindkey -N a main
% bindkey -s '^[t' 'echo test' -M a
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? It's a matter of providing one well written options parsing
function, isn't it.
That said, following zparseopts apparently fails:
% set -- a -b something -- -c
% typeset -A opts
% zparseopts -A opts -DE b: c
% echo "${(kv)opts}"
% # $1, $2, ... $5 are still the same
I once (12 years ago) used zparseopts this way and it worked great.
The call had to be different then.
Best regards,
Sebastian Gniazdowski
Messages sorted by:
Reverse Date,
Date,
Thread,
Author