zsh-workers
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: zsh-workers@zsh.org
Subject: Re: php completion
Date: Sun, 01 Jun 2014 11:04:05 -0700	[thread overview]
Message-ID: <140601110405.ZM29979@torch.brasslantern.com> (raw)
In-Reply-To: <2490411401615311@web8g.yandex.ru>

On Jun 1,  3:35pm, zabolotnyh stanislav wrote:
}
} Add extension phar.

Pardon me -- is this a request, or was there supposed to be a patch here
but it got lost?

Do you perhaps mean something like this?  This makes php completion look
for the suffixes style and complete any files having suffixes in that
list, defaulting to (php|phar).

diff --git a/Completion/Unix/Command/_php b/Completion/Unix/Command/_php
index bbb6a66..5d7b84e 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"


      reply	other threads:[~2014-06-01 18:04 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-01  9:35 zabolotnyh stanislav
2014-06-01 18:04 ` Bart Schaefer [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=140601110405.ZM29979@torch.brasslantern.com \
    --to=schaefer@brasslantern.com \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).