about summary refs log tree commit diff
path: root/Completion/User/_perldoc
blob: cd5383a4597a155d028a0c42f540263b0cbb659a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#compdef perldoc
#
#
# _perldoc - zsh completion function for perldoc
#
# Adam Spiers <adam@spiers.net>
#
# Behaviour should be roughly equivalent to:
# compctl -k perl_modules -k perl_basepods -f 
#           -x 'c[-1,-f]' -k perl_funcs --
#	  + -k man_pages
#     perldoc

if [[ $CURRENT -eq 3 && $words[2] == '-f' ]]; then
  _perl_builtin_funcs
elif [[ $CURRENT -eq 3 && $words[2] == '-q' ]]; then
  zle -R "I can't read your mind!"
else
  _perl_modules
  _perl_basepods
  _path_files -/ -g '*.(pod|pm)'
fi