From 10dc2b02dabc5d3ba4f4cfa5a62b0945f03191ef Mon Sep 17 00:00:00 2001 From: Sven Wischnowsky Date: Mon, 2 Apr 2001 11:40:15 +0000 Subject: moved from Completion/User/_perl_builtin_funcs --- Completion/Unix/Type/_perl_builtin_funcs | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 Completion/Unix/Type/_perl_builtin_funcs (limited to 'Completion/Unix/Type/_perl_builtin_funcs') diff --git a/Completion/Unix/Type/_perl_builtin_funcs b/Completion/Unix/Type/_perl_builtin_funcs new file mode 100644 index 000000000..65eebf9b1 --- /dev/null +++ b/Completion/Unix/Type/_perl_builtin_funcs @@ -0,0 +1,31 @@ +#autoload +# +# _perl_builtin_funcs - zsh completion function +# +# Adam Spiers +# +# Calculate all built-in Perl functions. The result is cached +# for future use. +# + +if [[ ${+_perl_builtin_funcs} -eq 0 ]]; then + typeset -agU _perl_builtin_funcs + local perlfunc + + if [[ -n "${perlfunc:=$(man -w perlfunc 2>/dev/null; print -l ${^manpath}/man1/perlfunc.1(N) {/usr/man,/usr/share/man,/usr/local/man}/man1/perlfunc.1(N))}" ]]; then + _perl_builtin_funcs=( `perl -lne ' + $in_funcs++, next if /Alphabetical/; \ + next unless $in_funcs; \ + if (/^\.Ip "(\w+)/) { \ + print $1 unless $func{$1}; $func{$1}++ \ + }' $=perlfunc` + ) + else + echo "Couldn't find perlfunc man page; giving up." + return 1 + fi +fi + +local expl + +_wanted functions expl 'Perl built-in functions' compadd -a _perl_builtin_funcs -- cgit 1.4.1