summary refs log tree commit diff
diff options
context:
space:
mode:
authorBarton E. Schaefer <schaefer@zsh.org>2014-06-01 15:21:13 -0700
committerBarton E. Schaefer <schaefer@zsh.org>2014-06-01 15:21:13 -0700
commitf5ad1ccbd6dc6230f0344635791db3fd11966a3a (patch)
tree02e14dc3e4b25fd2e55f077cae343fa6f9903b6a
parent19f3161e51dc880093cb71584f75b77a6084d52e (diff)
downloadzsh-f5ad1ccbd6dc6230f0344635791db3fd11966a3a.tar.gz
zsh-f5ad1ccbd6dc6230f0344635791db3fd11966a3a.tar.xz
zsh-f5ad1ccbd6dc6230f0344635791db3fd11966a3a.zip
32653: complete files with the ".phar" extension as well as ".php"
Also respect the suffixes zstyle to change the extensions
-rw-r--r--ChangeLog4
-rw-r--r--Completion/Unix/Command/_php5
2 files changed, 8 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 5a4f79080..cf25fda8f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2014-06-01  Barton E. Schaefer  <schaefer@zsh.org>
 
+	* 32653: Completion/Unix/Command/_php: complete files with the
+	".phar" extension as well as ".php", and respect the suffixes
+	zstyle to change this
+
 	* 32634 (plus doc): Doc/Zsh/options.yo, Doc/Zsh/params.yo,
 	Src/init.c, Src/options.c, Src/params.c, Src/zsh.h: add the
 	POSIX_ARGZERO option to allow toggling between the original
diff --git a/Completion/Unix/Command/_php b/Completion/Unix/Command/_php
index bbb6a667b..5d7b84e28 100644
--- a/Completion/Unix/Command/_php
+++ b/Completion/Unix/Command/_php
@@ -7,7 +7,10 @@ local curcontext="$curcontext" line state expl
 typeset -A opt_args
 
 local -a args
-local exclusions php_files=':PHP file:_files -g "*.php(-.)"'
+local exclusions php_suffix
+
+zstyle -s ":completion:$curcontext" suffixes php_suffix '|' || php_suffix='php|phar'
+local php_files=":PHP file:_files -g '*.($php_suffix)(-.)'"
 
 if _pick_variant php5=PHP\ 5 php4 --version; then
   exclusions="-B --process-begin -R --process-code -F --process-file -E --process-end"