Oliver Paulus | 18 Sep 19:55

zsh completion problem

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)


Gmane