about summary refs log tree commit diff
path: root/Completion/Unix
diff options
context:
space:
mode:
authorOliver Kiddle <opk@users.sourceforge.net>2003-04-24 12:31:15 +0000
committerOliver Kiddle <opk@users.sourceforge.net>2003-04-24 12:31:15 +0000
commit7f9b62612b74e8030e2fda7c32516fc5cb52b540 (patch)
treec4ea9092cdc64ff61163b893b37e31ac6860db8b /Completion/Unix
parent5d7977d37e51212bbf855bedf69e0b3e8c2ff43a (diff)
downloadzsh-7f9b62612b74e8030e2fda7c32516fc5cb52b540.tar.gz
zsh-7f9b62612b74e8030e2fda7c32516fc5cb52b540.tar.xz
zsh-7f9b62612b74e8030e2fda7c32516fc5cb52b540.zip
18468: use perldoc -u to get perlfunc doc instead of searching for the man page
Diffstat (limited to 'Completion/Unix')
-rw-r--r--Completion/Unix/Type/_perl_builtin_funcs30
1 files changed, 3 insertions, 27 deletions
diff --git a/Completion/Unix/Type/_perl_builtin_funcs b/Completion/Unix/Type/_perl_builtin_funcs
index 1c01a0dd6..829a53e60 100644
--- a/Completion/Unix/Type/_perl_builtin_funcs
+++ b/Completion/Unix/Type/_perl_builtin_funcs
@@ -1,33 +1,9 @@
 #autoload
-#
-# Parses perlfunc(1) to get a list of perl functions. The result is cached
-# for future use.
-
-if (( ! $+_perl_builtin_funcs )); then
-  typeset -agU _perl_builtin_funcs
-  local perlfunc
-
-  if [[ -n "${perlfunc:=$(man -w perlfunc 2>/dev/null; print -l ${^manpath:-${(s.:.)$(manpath)}}/man1/perlfunc.1(|[zZ]|gz|bz2)(N) {/usr/man,/usr/share/man,/usr/local/man}/man1/perlfunc.1(|[zZ]|gz|bz2)(N))}" ]]; then
-    case $perlfunc in
-      *.bz2) perlfunc="bzip2 -cd $perlfunc" ;;
-      *[zZ]) perlfunc="gzip -cd $perlfunc" ;;
-      *) perlfunc="cat $perlfunc" ;;
-    esac
-    _perl_builtin_funcs=(
-      $($=perlfunc | perl -lne '
-      $in_funcs++, next if /Alphabetical/;
-      next unless $in_funcs;
-      if (/^\.I[pP] "(\w+)/) {
-        print $1 unless $func{$1}; $func{$1}++
-      }')
-    )
-  else
-    _message "can't find perlfunc man page; giving up"
-    return 1
-  fi
-fi
 
 local expl
 
+: ${(A)_perl_builtin_funcs:=${(u)${${(M)${(f)"$(_call_program functions \
+    perldoc -u perlfunc 2>/dev/null)"}:#\=item [a-z]*}#* }%%[^a-z]*}}
+
 _wanted functions expl 'perl built-in function' compadd "$@" -a - \
     _perl_builtin_funcs