1
0
mirror of git://git.code.sf.net/p/zsh/code synced 2024-11-20 14:04:03 +01:00
zsh/Completion/User/_perl_basepods

33 lines
716 B
Plaintext
Raw Normal View History

1999-09-06 00:04:03 +02:00
#autoload
#
# _perl_basepods - zsh completion function
#
# Adam Spiers <adam@spiers.net>
#
# Calculate all installed Perl base pods (perlfunc, perlfaq etc.).
# The result is cached for future use.
#
if [[ ${+_perl_basepods} -eq 0 ]]; then
typeset -agU _perl_basepods
2000-05-23 20:06:32 +02:00
if (( ${+commands[basepods]} )); then
1999-09-06 00:04:03 +02:00
_perl_basepods=( ${$(basepods):t:r} )
else
local podpath
2000-05-23 20:06:32 +02:00
1999-09-06 00:04:03 +02:00
podpath=$(perl -MConfig -e 'print "$Config{installprivlib}/pod"')
2000-05-23 20:06:32 +02:00
1999-09-06 00:04:03 +02:00
if [[ ! -e $podpath/perl.pod ]]; then
echo "Couldn't find perl.pod from Config.pm; giving up."
return 1
else
2000-05-23 20:06:32 +02:00
_perl_basepods=( ${podpath}/*.pod(:r:t) )
1999-09-06 00:04:03 +02:00
fi
fi
fi
2000-05-23 20:06:32 +02:00
local expl
_wanted pods expl 'Perl base pods' compadd - $_perl_basepods