Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Question about _directories
- X-seq: zsh-users 12792
- From: Peter Stephenson <pws@xxxxxxx>
- Subject: Re: Question about _directories
- Date: Fri, 18 Apr 2008 11:11:08 +0100
- Cc: zsh-users@xxxxxxxxxx
- In-reply-to: <20080416185609.3307e869@xxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- Organization: CSR
- References: <20080416185609.3307e869@xxxxxxxxxxxxxxx>
On Wed, 16 Apr 2008 18:56:09 +0200
Mark Daniel Reidel <mark@xxxxxxxxxxx> wrote:
> I'm currently writing a file for tab-completion of a script and I have
> a problem: on a certain parameter, it has to accept all
> sub-sub-directories of /usr/ports. So /usr/ports/a/b/ is good,
> but /usr/ports/a/b/c should not be found. Of course /usr/ports/a<tab>
> should list everything starting with a as well, but how can I limit
> that it should only work 2 directories deep with _directories?
I think a fairly simple wrapper will work. Try something like:
if [[ $PREFIX = /usr/ports/*/*/* ]]; then
return 1
else
_directories
fi
Then point completion for the script at this function instead of
_directories.
--
Peter Stephenson <pws@xxxxxxx> Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK Tel: +44 (0)1223 692070
Messages sorted by:
Reverse Date,
Date,
Thread,
Author