18 Sep 19:55
zsh completion problem
From: Oliver Paulus <oliver <at> webprojekt.it>
Subject: zsh completion problem
Newsgroups: gmane.comp.shells.zsh.devel
Date: 2008-09-18 17:56:14 GMT
Expires: This article expires on 2008-10-02
Subject: zsh completion problem
Newsgroups: gmane.comp.shells.zsh.devel
Date: 2008-09-18 17:56:14 GMT
Expires: This article expires on 2008-10-02
Hello,
I have developed svc-restart, svc-stop, etc. helper functions to call
/etc/init.d scripts. Here is the configuration:
---conf start
function _c-getdaemons() {
if [[ -r /etc/init.d ]] ; then
local f
for f in /etc/init.d/*(:t); _wanted module expl
'daemons' compadd $f ;
fi
}
if [[ -d /etc/init.d ]] ; then
for i in svc-start svc-restart svc-stop svc-force-reload svc-reload ; do
eval "function $i() {
$SUDO /etc/init.d/\$1 ${i/#svc-/}
}";
compdef _c-getdaemons $i
done
fi
---end
Now my problem: If I call zsh the first time I do not get the right
completion. I type "svc-restart <TAB>" and I get the "files"
completion. If I "reload" zsh - and try it again I get the "daemons"
completion I have defined. Here is the reload function I use:
---conf start
function reload() {
(Continue reading)
RSS Feed