Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 58198 - ZSH completion function for gcc-config and genlop
Summary: ZSH completion function for gcc-config and genlop
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High enhancement (vote)
Assignee: Mamoru KOMACHI (RETIRED)
Depends on:
Reported: 2004-07-24 08:56 UTC by oberyno
Modified: 2004-08-12 12:25 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---

genlop completion (_genlop,4.14 KB, text/plain)
2004-07-24 08:58 UTC, oberyno
gcc-config completion (_gcc-config,1.10 KB, text/plain)
2004-07-24 08:58 UTC, oberyno
new genlop completion (_genlop,5.58 KB, text/plain)
2004-07-30 09:13 UTC, oberyno
equery and gensync completion (_gentoo_dev,4.50 KB, text/plain)
2004-07-30 09:14 UTC, oberyno
emerge patch (portage.patch,5.13 KB, patch)
2004-07-30 09:15 UTC, oberyno
Details | Diff
_gentoo_dev (_gentoo_dev,6.82 KB, text/plain)
2004-08-12 05:43 UTC, oberyno

Note You need to log in before you can comment on or make changes to this bug.
Description oberyno 2004-07-24 08:56:44 UTC
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

Actual Results:  
genlop and gcc-config completion
Comment 1 oberyno 2004-07-24 08:58:06 UTC
Created attachment 36064 [details]
genlop completion
Comment 2 oberyno 2004-07-24 08:58:42 UTC
Created attachment 36065 [details]
gcc-config completion
Comment 3 Mamoru KOMACHI (RETIRED) gentoo-dev 2004-07-24 10:58:23 UTC
The next release is coming soon. I'll include these completions then.
Comment 4 oberyno 2004-07-30 09:12:55 UTC
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 oberyno 2004-07-30 09:13:59 UTC
Created attachment 36469 [details]
new genlop completion
Comment 6 oberyno 2004-07-30 09:14:47 UTC
Created attachment 36470 [details]
equery and gensync completion
Comment 7 oberyno 2004-07-30 09:15:27 UTC
Created attachment 36471 [details, diff]
emerge patch
Comment 8 oberyno 2004-08-12 05:43:04 UTC
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.
Comment 9 Mamoru KOMACHI (RETIRED) gentoo-dev 2004-08-12 12:25:24 UTC
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.