Bug 58198 - ZSH completion function for gcc-config and genlop
Bug#: 58198 Product:  Gentoo Linux Version: unspecified Platform: All
OS/Version: Linux Status: RESOLVED Severity: enhancement Priority: P2
Resolution: FIXED Assigned To: usata@gentoo.org Reported By: oberyno@gmail.com
Component: Applications
URL: 
Summary: ZSH completion function for gcc-config and genlop
Keywords:  
Status Whiteboard: 
Opened: 2004-07-24 08:56 0000
Description:   Opened: 2004-07-24 08:56 0000
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). 

Reproducible: Always
Steps to Reproduce:
1.cp _genlop _gcc-config /usr/share/zsh/site-functions
2. rm ~/.zcompdump && zsh
3.

Actual Results:  
genlop and gcc-config completion

------- Comment #1 From oberyno 2004-07-24 08:58:06 0000 -------
Created an attachment (id=36064) [details]
genlop completion

------- Comment #2 From oberyno 2004-07-24 08:58:42 0000 -------
Created an attachment (id=36065) [details]
gcc-config completion

------- Comment #3 From Mamoru KOMACHI (RETIRED) 2004-07-24 10:58:23 0000 -------
The next release is coming soon. I'll include these completions then.

------- Comment #4 From oberyno 2004-07-30 09:12:55 0000 -------
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
in ~/.zshrc
also it's set to update the cache once a week; this should be easy to change

removed inject from single args
added --ask
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)

------- Comment #5 From oberyno 2004-07-30 09:13:59 0000 -------
Created an attachment (id=36469) [details]
new genlop completion

------- Comment #6 From oberyno 2004-07-30 09:14:47 0000 -------
Created an attachment (id=36470) [details]
equery and gensync completion

------- Comment #7 From oberyno 2004-07-30 09:15:27 0000 -------
Created an attachment (id=36471) [details]
emerge patch

------- Comment #8 From oberyno 2004-08-12 05:43:04 0000 -------
Created an attachment (id=37277) [details]
_gentoo_dev 

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. 

------- Comment #9 From Mamoru KOMACHI (RETIRED) 2004-08-12 12:25:24 0000 -------
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.