From 4a34edc4855ef9d6a74c4658a2ed4f0f8bc1f130 Mon Sep 17 00:00:00 2001 From: Tanaka Akira Date: Sun, 5 Sep 1999 22:04:03 +0000 Subject: Initial revision --- Completion/User/_perl_basepods | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 Completion/User/_perl_basepods (limited to 'Completion/User/_perl_basepods') diff --git a/Completion/User/_perl_basepods b/Completion/User/_perl_basepods new file mode 100644 index 000000000..f4e70382b --- /dev/null +++ b/Completion/User/_perl_basepods @@ -0,0 +1,30 @@ +#autoload +# +# _perl_basepods - zsh completion function +# +# Adam Spiers +# +# 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 + + if which basdepods >/dev/null; then + _perl_basepods=( ${$(basepods):t:r} ) + else + local podpath + podpath=$(perl -MConfig -e 'print "$Config{installprivlib}/pod"') + if [[ ! -e $podpath/perl.pod ]]; then + echo "Couldn't find perl.pod from Config.pm; giving up." + return 1 + else + cd $podpath + _perl_basepods=( *.pod(:r:t) ) + cd $OLDPWD + fi + fi +fi + +compadd - $_perl_basepods -- cgit 1.4.1