26763: fix problem on failed cd -s to relative path
[zsh.git] / Completion / Unix / Type / _perl_basepods
blob80a8c8321c4e0f2a36113de3592a280d3acf866a
1 #autoload
3 # _perl_basepods - zsh completion function
5 # Adam Spiers <adam@spiers.net>
7 # Calculate all installed Perl base pods (perlfunc, perlfaq etc.).
8 # The result is cached for future use.
11 if (( ! $+_perl_basepods )); then
12   typeset -agU _perl_basepods
14   if (( ${+commands[basepods]} )); then
15     _perl_basepods=( ${$(basepods):t:r} )
16   else
17     local podpath
19     podpath=$(perl -MConfig -e 'print "$Config{installprivlib}/pod"')
21     if [[ ! -e $podpath/perl.pod ]]; then
22       _message "can't find perl.pod from Config.pm; giving up"
23       return 1
24     else
25       _perl_basepods=( ${podpath}/*.pod(:r:t) )
26     fi
27   fi
30 local expl
32 _wanted pods expl 'perl base pod' compadd -a "$@" - _perl_basepods