zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <p.w.stephenson@ntlworld.com>
To: zsh-workers@zsh.org
Subject: Re: 'zcat -f' completion should not filter based on file extension.
Date: Wed, 29 May 2013 19:17:27 +0100	[thread overview]
Message-ID: <20130529191727.0dd177d4@pws-pc.ntlworld.com> (raw)
In-Reply-To: <20130527204529.GA1340@tixod.com>

On Mon, 27 May 2013 16:45:29 -0400
Evan Teitelman <teitelmanevan@gmail.com> wrote:
> zcat's completion script only matches files with '.gz' extensions. The
> '-f' flag should cause zcat's completion script to stop filtering
> completion matches based on their extensions. According to the gzip
> manpage, zcat is able to accept and print non-gzip files when passed
> '-f'.

diff --git a/Completion/Unix/Command/_gzip b/Completion/Unix/Command/_gzip
index 5c88fac..a90f232 100644
--- a/Completion/Unix/Command/_gzip
+++ b/Completion/Unix/Command/_gzip
@@ -82,7 +82,11 @@ files)
       _files "$expl[@]" -g '^*.(([tT]|)[gG]|)[zZ](-.)' && return
     else
       _description files expl 'compressed file'
-      _files "$expl[@]" -g '*.(([tT]|)[gG]|)[zZ](-.)' && return
+      if (( $+opt_args[-f] )); then
+	_files "$expl[@]" && return
+      else
+	_files "$expl[@]" -g '*.(([tT]|)[gG]|)[zZ](-.)' && return
+      fi
     fi
   fi
   ;;

-- 
Peter Stephenson <p.w.stephenson@ntlworld.com>
Web page now at http://homepage.ntlworld.com/p.w.stephenson/


  reply	other threads:[~2013-05-29 18:17 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-27 20:45 Evan Teitelman
2013-05-29 18:17 ` Peter Stephenson [this message]
2013-05-29 22:28   ` Bart Schaefer

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=20130529191727.0dd177d4@pws-pc.ntlworld.com \
    --to=p.w.stephenson@ntlworld.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).