zsh-workers
 help / color / mirror / code / Atom feed
From: Adam Spiers <adam@thelonious.new.ox.ac.uk>
To: zsh workers mailing list <zsh-workers@sunsite.auc.dk>
Subject: PATCH: _rpm tweaks (_files vs _path_files discussion)
Date: Thu, 16 Sep 1999 17:03:07 +0100	[thread overview]
Message-ID: <19990916170307.A17563@thelonious.new.ox.ac.uk> (raw)

Now people may disagree with this, but I would have thought that in
many completion scenarios, _path_files -/ -g <glob> is more
appropriate than _files -g <glob>.  For example, when completing tar
archives, if there are none in directory foo, and you type 

  % tar zxf foo/<TAB>

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


             reply	other threads:[~1999-09-16 16:03 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-09-16 16:03 Adam Spiers [this message]
1999-09-16 16:08 ` Peter Stephenson
1999-09-17  7:28 Sven Wischnowsky

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=19990916170307.A17563@thelonious.new.ox.ac.uk \
    --to=adam@thelonious.new.ox.ac.uk \
    --cc=adam@spiers.net \
    --cc=zsh-workers@sunsite.auc.dk \
    /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).