Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Writing a completion using _values with suffix options
- X-seq: zsh-users 20700
- From: zv <zv@xxxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: Writing a completion using _values with suffix options
- Date: Tue, 6 Oct 2015 14:58:27 -0700
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
In the process of writing completions for the linux /libcap/ tool chain,
I ran across a completion scripting complication that has had me
docsnarfing for some time:
libcap binaries accept a comma delimited list of capabilities in
/cap_from_text(3)/ format as a parameter, e.g
> setcap cap_sys_audit,cap_net_raw,cap_sys_chgid=ep
The /_values/ utility builtin is very useful for completing the
capabilities themselves, but I cannot find a builtin that cleanly
handles the Unix style-options suffix (the terminating =e|i|p) WITHOUT
manually processing the current completion string (say, by processing
$PREFIX & $IPREFIX after setting /compset -P/).
Could this be done with an /_arguments/ spec or /_alternative/ or is
there another way to do this cleanly?
- zv
Messages sorted by:
Reverse Date,
Date,
Thread,
Author