Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Writing a completion using _values with suffix options



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