* 'zcat -f' completion should not filter based on file extension.
@ 2013-05-27 20:45 Evan Teitelman
2013-05-29 18:17 ` Peter Stephenson
0 siblings, 1 reply; 3+ messages in thread
From: Evan Teitelman @ 2013-05-27 20:45 UTC (permalink / raw)
To: zsh-workers
[-- Attachment #1: Type: text/plain, Size: 280 bytes --]
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'.
[-- Attachment #2: Type: application/pgp-signature, Size: 490 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: 'zcat -f' completion should not filter based on file extension.
2013-05-27 20:45 'zcat -f' completion should not filter based on file extension Evan Teitelman
@ 2013-05-29 18:17 ` Peter Stephenson
2013-05-29 22:28 ` Bart Schaefer
0 siblings, 1 reply; 3+ messages in thread
From: Peter Stephenson @ 2013-05-29 18:17 UTC (permalink / raw)
To: zsh-workers
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/
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-05-29 22:29 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-05-27 20:45 'zcat -f' completion should not filter based on file extension Evan Teitelman
2013-05-29 18:17 ` Peter Stephenson
2013-05-29 22:28 ` Bart Schaefer
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).