From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8250 invoked by alias); 29 Sep 2012 13:25:32 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 30710 Received: (qmail 27291 invoked from network); 29 Sep 2012 13:25:21 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_PASS, UNPARSEABLE_RELAY autolearn=ham version=3.3.2 Received-SPF: pass (ns1.primenet.com.au: SPF record at schrab.com designates 50.116.43.67 as permitted sender) From: Aaron Schrab To: zsh-workers@zsh.org Subject: [PATCH] Update perldoc completion Date: Sat, 29 Sep 2012 09:19:30 -0400 Message-Id: <1348924770-9779-1-git-send-email-aaron@schrab.com> X-Mailer: git-send-email 1.7.10.4 Starting with perl 5.12, perldoc -v displays documentation on special variables, not verbose output. Also the -D option was added to describe the search for the requested item. --- Completion/Unix/Command/_perldoc | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/Completion/Unix/Command/_perldoc b/Completion/Unix/Command/_perldoc index 8c816b5..3e58d5a 100644 --- a/Completion/Unix/Command/_perldoc +++ b/Completion/Unix/Command/_perldoc @@ -15,14 +15,15 @@ fi _arguments -C -s -S -A "-*" \ '(- *)-h[print help information]' \ '(- *)-V[display version information]' \ - '-v[verbose output]' \ + '-D[describe search for the item]' \ '-t[use plain text output instead of nroff]' \ '-u[show raw Pod source]' \ '*-m[display entire module]:module:_perl_modules' \ '-l[display only filename of the module found]' \ '-F[consider arguments as filenames]' \ - '(-q)-f+[view documentation for Perl built-in function]:perl builtin function:->perl-builtin-funcs' \ - '(-f)-q+[search question headings in Perl FAQ]:regular expression' \ + '(-q -v)-f+[view documentation for Perl built-in function]:perl builtin function:->perl-builtin-funcs' \ + '(-f -v)-q+[search question headings in Perl FAQ]:regular expression' \ + '(-f -q)-v+[view documentation for predefined variable]:special variable:->perl-variables' \ '(-d)-T[send output direct to stdout and not via pager]' \ '(-T)-d+[specify output file]:output file:_files' \ '-o+[specify output format]:output format:(man nroff pod rtf text tk xml latex)' \ @@ -54,6 +55,14 @@ case $state in 'files:module or .pod file:_files -g "*.(pod|pm)(-.)"' && ret=0 fi ;; + + perl-variables) + : ${(A)_perl_special_vars:=${(u)${${${(M)${(f)"$(_call_program variables \ + perldoc -u perlvar 2>/dev/null)"}:#\=item [\$\@\%]*}#* }:#\$