about summary refs log tree commit diff
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2009-01-19 10:28:30 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2009-01-19 10:28:30 +0000
commit8541ccb842c27c8e8ff14e4e0718f7b14efee0b2 (patch)
tree9fa3a17d70da9e439692afb713181db8e8b4992d
parente2b9d8d181b3994c4357a2f94545046ea3f1d3ab (diff)
downloadzsh-8541ccb842c27c8e8ff14e4e0718f7b14efee0b2.tar.gz
zsh-8541ccb842c27c8e8ff14e4e0718f7b14efee0b2.tar.xz
zsh-8541ccb842c27c8e8ff14e4e0718f7b14efee0b2.zip
Doug Kearns: 26365: new python 3.0 options
-rw-r--r--ChangeLog7
-rw-r--r--Completion/Unix/Command/_python30
2 files changed, 29 insertions, 8 deletions
diff --git a/ChangeLog b/ChangeLog
index 1c3c451bb..2963acfdb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2009-01-19  Peter Stephenson  <pws@csr.com>
+
+	* Doug Kearns: 26365: Completion/Unix/Command/_python: new 3.0
+	options.
+
 2009-01-19  Wayne Davison  <wayned@users.sourceforge.net>
 
 	* 26362: Src/Modules/regex.c: avoid calling regfree() when the
@@ -10943,5 +10948,5 @@
 
 *****************************************************
 * This is used by the shell to define $ZSH_PATCHLEVEL
-* $Revision: 1.4516 $                         
+* $Revision: 1.4517 $                         
 *****************************************************
diff --git a/Completion/Unix/Command/_python b/Completion/Unix/Command/_python
index be27f8300..ca1ed37fd 100644
--- a/Completion/Unix/Command/_python
+++ b/Completion/Unix/Command/_python
@@ -1,23 +1,39 @@
 #compdef python
 
-# Python 2.4
+# Python 2.6
+# Python 3.0
 
 local curcontext="$curcontext" state line expl
 typeset -A opt_args
 
-_arguments -C -s -S \
+local -a args
+
+if _pick_variant python3=Python\ 3 python2 --version; then
+  args=(
+    '(-bb)-b[issue warnings about str(bytes_instance), str(bytearray_instance) and comparing bytes/bytearray with str]'
+    '(-b)-bb[issue errors about str(bytes_instance), str(bytearray_instance) and comparing bytes/bytearray with str]'
+  )
+else
+  args=(
+    '-Q+[division options]:division option:(old warn warnall new)'
+    '(-tt)-t[issue warnings about inconsistent tab usage]'
+    '(-t)-tt[issue errors about inconsistent tab usage]'
+    '-3[warn about Python 3.x incompatibilities]'
+  )
+fi
+
+_arguments -C -s -S "$args[@]" \
+  "-B[don't write .py\[co\] files on import]" \
   '(1 -)-c+[program passed in as string (terminates option list)]:python command:' \
   '-d[debug output from parser]' \
-  '-E[ignore environment variables (such as PYTHONPATH)]' \
+  '-E[ignore PYTHON* environment variables (such as PYTHONPATH)]' \
   '(1 * -)-h[display help information]' \
   '-i[inspect interactively after running script]' \
   '(1 * -)-m[run library module as a script (terminates option list)]:module:->modules' \
-  '-O[optimize generated bytecode]' \
+  '-O[optimize generated bytecode slightly]' \
   '-OO[remove doc-strings in addition to the -O optimizations]' \
-  '-Q+[division options]:division option:(old warn warnall new)' \
+  "-s[don't add user site directory to sys.path]" \
   "-S[don't imply 'import site' on initialization]" \
-  '-t[issue warnings about inconsistent tab usage]' \
-  '-tt[issue errors about inconsistent tab usage]' \
   '-u[unbuffered binary stdout and stderr]' \
   '-v[verbose (trace import statements)]' \
   '(1 * -)-V[display version information]' \