summary refs log tree commit diff
path: root/Completion/Unix
diff options
context:
space:
mode:
authorSven Wischnowsky <wischnow@users.sourceforge.net>2001-04-02 11:39:58 +0000
committerSven Wischnowsky <wischnow@users.sourceforge.net>2001-04-02 11:39:58 +0000
commit4c5af127f4e64abcf02a1b8bd55b77e59eb5ecc4 (patch)
treee4b80df952148cf16b6a4e6f681439cab7f79d5d /Completion/Unix
parenta201dea6e742b02044205cbcd0bfc6ff838a624b (diff)
downloadzsh-4c5af127f4e64abcf02a1b8bd55b77e59eb5ecc4.tar.gz
zsh-4c5af127f4e64abcf02a1b8bd55b77e59eb5ecc4.tar.xz
zsh-4c5af127f4e64abcf02a1b8bd55b77e59eb5ecc4.zip
moved from Completion/User/_perl_basepods
Diffstat (limited to 'Completion/Unix')
-rw-r--r--Completion/Unix/Type/_perl_basepods32
1 files changed, 32 insertions, 0 deletions
diff --git a/Completion/Unix/Type/_perl_basepods b/Completion/Unix/Type/_perl_basepods
new file mode 100644
index 000000000..5c8034a96
--- /dev/null
+++ b/Completion/Unix/Type/_perl_basepods
@@ -0,0 +1,32 @@
+#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
+
+  if (( ${+commands[basepods]} )); 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
+      _perl_basepods=( ${podpath}/*.pod(:r:t) )
+    fi
+  fi
+fi
+
+local expl
+
+_wanted pods expl 'Perl base pods' compadd -a _perl_basepods