From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8038 invoked from network); 16 Sep 1999 16:03:15 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 16 Sep 1999 16:03:15 -0000 Received: (qmail 18834 invoked by alias); 16 Sep 1999 16:03:08 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 7870 Received: (qmail 18808 invoked from network); 16 Sep 1999 16:03:08 -0000 Date: Thu, 16 Sep 1999 17:03:07 +0100 From: Adam Spiers To: zsh workers mailing list Subject: PATCH: _rpm tweaks (_files vs _path_files discussion) Message-ID: <19990916170307.A17563@thelonious.new.ox.ac.uk> Reply-To: Adam Spiers Mail-Followup-To: zsh workers mailing list Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0pre2i X-URL: http://www.new.ox.ac.uk/~adam/ X-OS: Linux 2.2.9 i686 Now people may disagree with this, but I would have thought that in many completion scenarios, _path_files -/ -g is more appropriate than _files -g . For example, when completing tar archives, if there are none in directory foo, and you type % tar zxf foo/ getting a list of all files in the directory is fairly undesirable, no? Another case is completing *.spec and *.rpm files with _rpm, which irritated me enough to provide a patch :-) It's a matter of taste I suppose, but I'd be interested to hear whether I'm alone on this. Index: Completion/Linux/_rpm diff -u Completion/Linux/_rpm:1.1.1.2 Completion/Linux/_rpm:1.2 --- Completion/Linux/_rpm:1.1.1.2 Thu Sep 16 12:39:44 1999 +++ Completion/Linux/_rpm Thu Sep 16 13:00:22 1999 @@ -148,7 +148,7 @@ '*:RPM package:->package' && ret=0 ;; build_b) - tmp=( '*:spec file:_files -g \*.spec' ) + tmp=( '*:spec file:_path_files -/ -g \*.spec' ) ;& build_t) (( $#tmp )) || tmp=( '*:tar file:_files -g \*.\(\#i\)tar\(.\*\|\)' ) @@ -195,7 +195,7 @@ _hosts -S/ && ret=0 else _description expl 'RPM package file' - _files "$expl[@]" -g '*.(#i)rpm' && ret=0 + _path_files "$expl[@]" -/ -g '*.(#i)rpm' && ret=0 _description expl 'ftp URL prefix' compadd "$expl[@]" ftp:// fi