zsh-workers
 help / color / mirror / code / Atom feed
* PATCH: Completion/Unix/Command/_perl: Update for 5.10.1.
@ 2011-10-18 14:39 Simon Ruderich
  2011-10-18 20:59 ` Benjamin R. Haskell
  0 siblings, 1 reply; 5+ messages in thread
From: Simon Ruderich @ 2011-10-18 14:39 UTC (permalink / raw)
  To: zsh-workers

[-- Attachment #1: Type: text/plain, Size: 6374 bytes --]

---
Hello,

This patch updates _perl for Perl 5.10.1. My experience with the
completion is limited so if you find any mistakes or improvements
please tell me.

Regards,
Simon

 Completion/Unix/Command/_perl |   73 ++++++++++++++++++++++++++++++++++------
 1 files changed, 62 insertions(+), 11 deletions(-)

diff --git a/Completion/Unix/Command/_perl b/Completion/Unix/Command/_perl
index 20d9f2d..18e01e5 100644
--- a/Completion/Unix/Command/_perl
+++ b/Completion/Unix/Command/_perl
@@ -3,17 +3,23 @@
 # zsh completion code for the Perl interpreter
 # Adam Spiers <adam@spiers.net>
 #
+# Completions currently based on Perl 5.10.1.

 _perl () {
   _arguments -s \
-    '-0-:input record separator in octal (\0, if no argument): ' \
+    '-0-[input record separator ($/)]:$/ in octal or hex (\0, if no argument)' \
     '-a[autosplit mode with -n or -p (splits $_ into @F)]' \
+    '-C-[control some unicode features]: :_perl_unicode_flags' \
     "-c[check syntax only (runs BEGIN and END blocks)]" \
-    '-d[run scripts under debugger]' \
-    '-d\:-[run under control of a debugging/tracing module]:debugging/tracing module:_perl_modules --strip-prefix --perl-hierarchy=Devel' \
-    '-D-:set debugging flags (argument is a bit mask or flags): ' \
-    "*-e+:one line of script. Several -e's allowed. Omit [programfile]." \
-    "-F-:split() pattern for autosplit (-a). The //'s are optional.: " \
+    '(   -dt -d: -dt:)-d[run scripts under debugger]' \
+    '(-d     -d: -dt:)-dt[run scripts under debugger (debugged code uses threads)]' \
+    '(-d -dt     -dt:)-d\:-[run under control of a debugging/tracing module]:debugging/tracing module:_perl_modules --strip-prefix --perl-hierarchy=Devel' \
+    '(-d -dt -d:     )-dt\:-[run under control of a debugging/tracing module (debugged coded uses threads)]:debugging/tracing module:_perl_modules --strip-prefix --perl-hierarchy=Devel' \
+    '-D-[set debugging flags]: :_perl_debugging_flags' \
+    '(   -E)*-e+[run one line of program]:one line of program' \
+    '(-e   )*-E+[like -e but enable all optional features]:one line of program: ' \
+    '-f[disable executing $Config{sitelib}/sitecustomize.pl at startup]' \
+    '-F-[split() pattern for autosplit (-a)]:split() pattern, // is optional' \
     '-h[list help summary]' \
     '-i-[edit <> files in place (make backup if extension supplied)]:backup file extension: ' \
     '*-I-[specify @INC/#include directory (may be used more than once)]:include path:_files -/' \
@@ -21,18 +27,21 @@ _perl () {
     \*{-m,-M}"-[module.. executes \`use/no module...' before executing your script]:module:_perl_m_opt" \
     "-n[assume 'while (<>) { ... }' loop around your script]" \
     "-p[assume loop like -n but print line also like sed]" \
-    "-P[run script through C preprocessor before compilation]" \
+    '-P[run script through C preprocessor before compilation (deprecated)]' \
     "-s[enable some switch parsing for switches after script name]" \
     "-S[look for the script using PATH environment variable]" \
-    "-T[turn on tainted checks]" \
-    "-u[dump core after parsing script]" \
+    '(   -T)-t[turn on taint checks but only issue warnings]' \
+    '(-t   )-T[turn on taint checks]' \
+    '-u[dump core after parsing script (obsolete)]' \
     "-U[allow unsafe operations]" \
     "-v[print version number, patchlevel plus VERY IMPORTANT perl info]" \
     "-V-[print perl configuration information]:configuration keys:_perl_config_vars" \
-    '-w[turn warnings on for compilation of your script. Recommended]' \
+    '(   -W -X)-w[turn warnings on for compilation of your script (recommended)]' \
+    "(-w    -X)-W[enable all warnings (ignores 'no warnings')]" \
+    "(-w -W   )-X[disable all warnings (ignores 'use warnings')]" \
     '-x-[strip off text before #!perl line and perhaps cd to directory]:directory to cd to:_files -/' \
     '1:Perl script:_files -/ -g "*.(p[ml]|PL|t)(-.)"' \
-    '*::args: _normal'
+    '*::args: _normal'
 }

 _perl_m_opt () {
@@ -60,4 +69,46 @@ _perl_config_vars () {
   compadd "$expl[@]" $add_colon -S$delimiter -q -a _perl_config_vars
 }

+_perl_unicode_flags () {
+  _values -s '' 'unicode bitmask or flags' \
+    'I[  1 STDIN is assumed to be in UTF-8]' \
+    'O[  2 STDOUT will be in UTF-8]' \
+    'E[  4 STDERR will be in UTF-8]' \
+    'S[  7 I + O + E]' \
+    'i[  8 UTF-8 is the default PerlIO layer for input streams]' \
+    'o[ 16 UTF-8 is the default PerlIO layer for output streams]' \
+    'D[ 24 i + o]' \
+    'A[ 32 the @ARGV elements are expected to be strings encoded in UTF-8]' \
+    'L[ 64 make "IOEioA" conditional on the locale environment variables]' \
+    'a[256 set ${^UTF8CACHE} to -1, used for debugging]' \
+}
+
+_perl_debugging_flags () {
+  _values -s '' 'debugging bitmask or flags' \
+    'p[      1 Tokenizing and parsing (with v, displays parse stack)]' \
+    's[      2 Stack snapshots (with v, displays all stacks)]' \
+    'l[      4 Context (loop) stack processing]' \
+    't[      8 Trace execution]' \
+    'o[     16 Method and overloading resolution]' \
+    'c[     32 String/numeric conversions]' \
+    'P[     64 Print profiling info, preprocessor command for -P, source file input state]' \
+    'm[    128 Memory and SV allocation]' \
+    'f[    256 Format processing]' \
+    'r[    512 Regular expression parsing and execution]' \
+    'x[   1024 Syntax tree dump]' \
+    'u[   2048 Tainting checks]' \
+    'U[   4096 Unofficial, User hacking (reserved for private, unreleased use)]' \
+    'H[   8192 Hash dump -- usurps values()]' \
+    'X[  16384 Scratchpad allocation]' \
+    'D[  32768 Cleaning up]' \
+    'S[  66536 Thread synchronization]' \
+    'T[ 131072 Tokenising]' \
+    'R[ 262144 Include reference counts of dumped variables (eg when using -Ds)]' \
+    'J[ 524288 Do not s,t,P-debug (Jump over) opcodes within package DB]' \
+    'v[1048576 Verbose: use in conjunction with other flags]' \
+    'C[2097152 Copy On Write]' \
+    'A[4194304 Consistency checks on internal structures]' \
+    'q[8388608 quiet - currently only suppresses the "EXECUTING" message]' \
+}
+
 _perl "$@"
-- 
1.7.7

-- 
+ privacy is necessary
+ using gnupg http://gnupg.org
+ public key id: 0x92FEFDB7E44C32F9

[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: PATCH: Completion/Unix/Command/_perl: Update for 5.10.1.
  2011-10-18 14:39 PATCH: Completion/Unix/Command/_perl: Update for 5.10.1 Simon Ruderich
@ 2011-10-18 20:59 ` Benjamin R. Haskell
  2011-10-19 15:23   ` Simon Ruderich
  0 siblings, 1 reply; 5+ messages in thread
From: Benjamin R. Haskell @ 2011-10-18 20:59 UTC (permalink / raw)
  To: Simon Ruderich; +Cc: zsh-workers

On Tue, 18 Oct 2011, Simon Ruderich wrote:

> ---
> Hello,
>
> This patch updates _perl for Perl 5.10.1. My experience with the 
> completion is limited so if you find any mistakes or improvements 
> please tell me.

> -    "-u[dump core after parsing script]" \
> +    '-u[dump core after parsing script (obsolete)]' \

-u is still in blead perl.  Why did you add '(obsolete)'?

Other than that, it looks like you covered changes through 5.14.1 (or 
beyond... I checked by scanning perl{N}delta from 5101 through 5141, and 
then looking at the latest perl.c in blead).

For whoever applies this patch, there's a trailing space on the first 
line of these two (my mailer stripped it, I think -- so presumably 
others' might, too):

-    '*::args: _normal' 
+    '*::args: _normal'

-- 
Best,
Ben


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: PATCH: Completion/Unix/Command/_perl: Update for 5.10.1.
  2011-10-18 20:59 ` Benjamin R. Haskell
@ 2011-10-19 15:23   ` Simon Ruderich
  2011-10-19 15:44     ` Benjamin R. Haskell
  0 siblings, 1 reply; 5+ messages in thread
From: Simon Ruderich @ 2011-10-19 15:23 UTC (permalink / raw)
  To: zsh-workers

[-- Attachment #1: Type: text/plain, Size: 905 bytes --]

On Tue, Oct 18, 2011 at 04:59:58PM -0400, Benjamin R. Haskell wrote:
> [snip]
>
> -u is still in blead perl.  Why did you add '(obsolete)'?

I just followed the statement in the man-page:

    -u   This obsolete switch causes Perl [...]

> Other than that, it looks like you covered changes through 5.14.1 (or
> beyond... I checked by scanning perl{N}delta from 5101 through 5141, and
> then looking at the latest perl.c in blead).

Great, I'll update the comment.

> For whoever applies this patch, there's a trailing space on the first line
> of these two (my mailer stripped it, I think -- so presumably others' might,
> too):
>
> -    '*::args: _normal' +    '*::args: _normal'

Looks like my mail program stripped that, sorry.

Thanks for reviewing my patch.

Regards,
Simon
-- 
+ privacy is necessary
+ using gnupg http://gnupg.org
+ public key id: 0x92FEFDB7E44C32F9

[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: PATCH: Completion/Unix/Command/_perl: Update for 5.10.1.
  2011-10-19 15:23   ` Simon Ruderich
@ 2011-10-19 15:44     ` Benjamin R. Haskell
  2011-10-19 22:53       ` Simon Ruderich
  0 siblings, 1 reply; 5+ messages in thread
From: Benjamin R. Haskell @ 2011-10-19 15:44 UTC (permalink / raw)
  To: Simon Ruderich; +Cc: zsh-workers

On Wed, 19 Oct 2011, Simon Ruderich wrote:

> On Tue, Oct 18, 2011 at 04:59:58PM -0400, Benjamin R. Haskell wrote:
>> [snip]
>>
>> -u is still in blead perl.  Why did you add '(obsolete)'?
>
> I just followed the statement in the man-page:
>
>    -u   This obsolete switch causes Perl [...]

Huh.  Wasn't there in 5.14.1.  Looking at git, that text was reverted in 
May back to:

-u   This switch causes Perl to dump core [...]

So, apparently it's sticking around.

-- 
Best,
Ben


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: PATCH: Completion/Unix/Command/_perl: Update for 5.10.1.
  2011-10-19 15:44     ` Benjamin R. Haskell
@ 2011-10-19 22:53       ` Simon Ruderich
  0 siblings, 0 replies; 5+ messages in thread
From: Simon Ruderich @ 2011-10-19 22:53 UTC (permalink / raw)
  To: zsh-workers

[-- Attachment #1: Type: text/plain, Size: 589 bytes --]

On Wed, Oct 19, 2011 at 11:44:38AM -0400, Benjamin R. Haskell wrote:
> On Wed, 19 Oct 2011, Simon Ruderich wrote:
>> I just followed the statement in the man-page:
>>
>>   -u   This obsolete switch causes Perl [...]
>
> Huh.  Wasn't there in 5.14.1.  Looking at git, that text was reverted in May
> back to:
>
> -u   This switch causes Perl to dump core [...]
>
> So, apparently it's sticking around.

Thanks for looking into this, I'll drop the "obsolete".

Regards,
Simon
-- 
+ privacy is necessary
+ using gnupg http://gnupg.org
+ public key id: 0x92FEFDB7E44C32F9

[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2011-10-19 22:53 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-10-18 14:39 PATCH: Completion/Unix/Command/_perl: Update for 5.10.1 Simon Ruderich
2011-10-18 20:59 ` Benjamin R. Haskell
2011-10-19 15:23   ` Simon Ruderich
2011-10-19 15:44     ` Benjamin R. Haskell
2011-10-19 22:53       ` Simon Ruderich

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).