1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-11-01 06:20:55 +01:00
zsh/Completion/Builtins/_unhash
1999-11-03 11:07:12 +00:00

22 lines
575 B
Text

#compdef unhash
local fl="$words[2]" ret=1 expl
if [[ "$fl" = -*d* ]]; then
_description expl 'named directory'
compadd "$expl[@]" - "${(@k)nameddirs}" && ret=0
fi
if [[ "$fl" = -*a* ]]; then
_description expl alias
compadd "$expl[@]" - "${(@k)aliases}" "${(@k)dis_aliases}" \
"${(@k)galiases}" "${(@k)dis_galiases}" && ret=0
fi
if [[ "$fl" = -*f* ]]; then
_description expl 'shell function'
compadd "$expl[@]" - "${(@k)functions}" "${(@k)dis_functions}" && ret=0
fi
if [[ "$fl" != -* ]]; then
_command_names -e && ret=0
fi
return ret