From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29435 invoked by alias); 29 May 2013 18:17:53 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 31433 Received: (qmail 15956 invoked from network); 29 May 2013 18:17:38 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 Received-SPF: neutral (ns1.primenet.com.au: 209.85.212.180 is neither permitted nor denied by SPF record at ntlworld.com) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-proxyuser-ip:date:from:to:subject:message-id:in-reply-to :references:x-mailer:mime-version:content-type :content-transfer-encoding:x-gm-message-state; bh=RlI0RKJQ4Bwf+fLRTJDYn7oopeMUv+0GfEmuM/J54Fs=; b=axfEbEtdrR98nroHiJFuncgV2Pa334AwoMfEciQA/VCyJ1dzxlc7JxywiHUjHhLbtR xRz+4yaSFw16MIIWD5l9iRX5l4G4AEdJff0PUYM7utP/jVewt4qG2ulhNooo/ubVuIRy /cTYEopiv1pdpSiOy5I4o3Ke9Px6GEt6Vu518iEMS7ubVGzzLWMIgCNGv9fpWS2BmRrE 0315+tPLh/3DEpvEARMUTMaqWvg0yGlmE+OxcsHq98ZKbytYF9VHgmk8uYxKhhkzcZmM U0Pnd1UR6l19oZS+UaPAnuYiJ6mgyFf5x6yceqiO2OoNa5IshSbk+X8jVBRPbR5A3dxT oUnQ== X-Received: by 10.180.206.205 with SMTP id lq13mr16259032wic.56.1369851450811; Wed, 29 May 2013 11:17:30 -0700 (PDT) X-ProxyUser-IP: 86.6.30.159 Date: Wed, 29 May 2013 19:17:27 +0100 From: Peter Stephenson To: zsh-workers@zsh.org Subject: Re: 'zcat -f' completion should not filter based on file extension. Message-ID: <20130529191727.0dd177d4@pws-pc.ntlworld.com> In-Reply-To: <20130527204529.GA1340@tixod.com> References: <20130527204529.GA1340@tixod.com> X-Mailer: Claws Mail 3.8.0 (GTK+ 2.24.7; x86_64-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Gm-Message-State: ALoCoQkaly2x4EiBu/H99bK8FHVA5531cdyN4sPu+/CqYSJSQqV4alrf1SW2U1XSGBkIZeCgJK1a On Mon, 27 May 2013 16:45:29 -0400 Evan Teitelman 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 Web page now at http://homepage.ntlworld.com/p.w.stephenson/