mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-10-06 21:11:11 +02:00
24 lines
487 B
Text
24 lines
487 B
Text
#compdef compdef
|
|
|
|
local expl 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
|
|
_wanted commands expl 'completed command' &&
|
|
compadd "$expl[@]" - ${(k)_comps}
|
|
else
|
|
if [[ CURRENT -eq base ]]; then
|
|
_wanted functions expl 'completion function' &&
|
|
compadd "$expl[@]" - ${^fpath:/.}/_(|*[^~])(N:t)
|
|
else
|
|
_command_names
|
|
fi
|
|
fi
|