Attached are a couple completion functions for zsh. Gcc-config is complete. Genlop completes everything but date. The main difference between the genlop and the emerge unmerge functions is that genlop can work with pkgname(zsh) as opposed to just cat/pkgname-version(app-shells/zsh-4.2.0-r1).
Steps to Reproduce:
1.cp _genlop _gcc-config /usr/share/zsh/site-functions
2. rm ~/.zcompdump && zsh
genlop and gcc-config completion
Created attachment 36064 [details]
Created attachment 36065 [details]
The next release is coming soon. I'll include these completions then.
Ok, I've done a few more things. I cleaned up the genlop code and added basic date support. Also, I made completions for equery and gensync. Also an emerge patch.
Things I changed for emerge:
added =,>,<,<=,>= support (needs to be quoted, or escaped) i.e emerge \=zsh<tab>
added cache support for above, it is extremely slow if you do emerge \=<tab>, but reasonably fast for emerge \=g<tab> when cache is enabled
for cache support, user needs zstyle ':completion::complete:*' use-cache 1
also it's set to update the cache once a week; this should be easy to change
removed inject from single args
modified unmerge to work with pkgname in normal mode, pkg-ver with =,<,>
--skipfirst only works with --resume
--resume doesn't complete packages
removed _options (it wasn't doing anything)
Created attachment 36469 [details]
new genlop completion
Created attachment 36470 [details]
equery and gensync completion
Created attachment 36471 [details, diff]
Created attachment 37277 [details]
new equery, gensync, qpkg completion
My previous equery had problems completing multiple packages when it wasn't
supposed to. This fixes that.
Equery commands have to be in the format:
equery common_args action action_args file/package
where common_args are --quiet and --nocolor
Also, there are alot of options for qpkg, so it might not be perfect.
You are right about the speed of completion cache support. I hadn't tried your code yesterday, sorry about that. I asked one of the Portage dev about emerge --info syntax, and he said he thinks it's confusing to complete --info, --world, --sync and so on because a lot of people think without "--" is the correct syntax. I don't know whether the "--" syntax will be deprecated or not, but I come to think that we better not complete --info, --world, etc. As for genlop, I leave it to you. If you want to change the current code, please send me a patch to _genlop before I add 4.2.1 to CVS.
Thanks for the contribution you have made, and if you have any other improvements please let me know.