Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Proposal to use patterns in fake-files style

Is anybody out there going to be disadvantaged if I turn the directory
part of the fake-files completion style into a pattern?  This shouldn't
make any difference unless the directory currently has a pattern
character in it, which I think is highly unlikely for typical uses.

The reason I want this is that our Netapp file server has a magic
".snapshot" directory within every directory that doesn't appear in the
listing (except, for some reason, in the home directory).  So I want an
easy way to add that as fake entry on some file systems and not on
others.  This change would allow me to do

zstyle ':completion:*' fake-files '/home/*:.snapshot'

or if I'm feeling bold

zstyle -e ':completion:*' fake-files 'reply=("$(mount |
perl -ne '\''/^[^:]*netapp[^:]*:.* on (.*) type nfs/ and
  push @dirs, "$1";
  END { @dirs and print "(" . join("|", @dirs), ")/*:.snapshot\n" }'\'')")'

Let me know if you don't like this and I'll add a separate style like
fake-file-patterns instead.

Peter Stephenson <pws@xxxxxxx>                  Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK                          Tel: +44 (0)1223 692070

To access the latest news from CSR copy this link into a web browser:  http://www.csr.com/email_sig.php

To get further information regarding CSR, please visit our Investor Relations page at http://ir.csr.com/csr/about/overview

Messages sorted by: Reverse Date, Date, Thread, Author