about summary refs log tree commit diff
path: root/Completion/User/_perldoc
blob: 62fd18ca7aa2873f8239801b2b00468f2f0de8e3 (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
24
25
26
27
28
29
#compdef perldoc
#
# _perldoc - zsh completion function for perldoc
#
# Adam Spiers <adam@spiers.net>
#

_perldoc () {
  _arguments -s \
    '-h:help:' \
    '(-q)-f:Perl built-in function:_perl_builtin_funcs:*:' \
    '(-f)-q:Perl FAQ keyword:' \
    '*:Perl pod pages:_perl_pods'
}

_perl_pods () {
  local nm="$compstate[nmatches]"
  local expl
  
  _perl_modules
  _perl_basepods

  _description expl 'Perl modules and .pods'
  _files "$expl[@]"  -g '*.(pod|pm)'

  [[ nm -ne "$compstate[nmatches]" ]]
}

_perldoc "$@"