Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
zsh completion problem
- X-seq: zsh-users 13246
- From: Oliver Paulus <oliver@xxxxxxxxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: zsh completion problem
- Date: Thu, 18 Sep 2008 19:56:14 +0200
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- Organization: http://freemail.web.de/
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() {
if [[ "$#*" -eq 0 ]]; then
test -r /etc/zsh/zsh-oli && . /etc/zsh/zsh-oli
test -r ~/.zshrc && . ~/.zshrc
return 0
else
local fn
for fn in $*; do
unfunction $fn
autoload -U $fn
done
fi
}
compdef _functions reload
---end
--
Oliver Paulus
OpenPGP
Key id: 28D9C44F
Fingerprint: EADA 62FC 07DC 3361 A3D6 4174 2DE3 C027 28D9 C44F
Public Key: http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x28D9C44F
_________________________________________________________________________
In 5 Schritten zur eigenen Homepage. Jetzt Domain sichern und gestalten!
Nur 3,99 EUR/Monat! http://www.maildomain.web.de/?mc=021114
Messages sorted by:
Reverse Date,
Date,
Thread,
Author