1
0
mirror of git://git.code.sf.net/p/zsh/code synced 2024-11-19 21:44:11 +01:00
zsh/Completion/Builtins/_compdef
1999-09-22 12:35:29 +00:00

23 lines
376 B
Plaintext

#compdef compdef
local func base=2
while [[ $words[base] = -* ]]; do
case $words[base] in
-d) delete=yes ;;
-p) type=pattern ;;
-k) type=key ;;
esac
(( base++ ))
done
if [ "$delete" ]; then
compadd ${(k)_comps}
else
if [[ CURRENT -eq base ]]; then
for func in ${^~fpath:/.}/_(|*[^~])(N:t); compadd -P_ - ${func#_}
else
compgen -c
fi
fi