Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: filename completions with prefixes
- X-seq: zsh-users 8383
- From: William Scott <wgscott@xxxxxxxxxxxxxxxxxx>
- To: Wataru Kagawa <wkagawa@xxxxxxxxxxxxxxxxxxxx>
- Subject: Re: filename completions with prefixes
- Date: Mon, 17 Jan 2005 07:09:48 -0800 (PST)
- Cc: zsh-users@xxxxxxxxxx
- In-reply-to: <46C3F20E-6850-11D9-87FF-000A95A6799C@xxxxxxxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
Hi Wataru:
Doubtless there are better ways, but one simple-minded
approach is to define a function pdbset that works with
your current completion:
#!/bin/zsh -f
function pdbset {
command pdbset XYZIN $1 XYZOUT $2
}
The other alternative is to treat XYZIN as an argument
to be completed obligatorily at postion 1
(same with XYZOUT in position 3).
HTH,
Bill
On Mon, 17 Jan 2005, Wataru Kagawa wrote:
> I am trying to write a completion function for a command called pdbset
> in which *.pdb files are completed with the prefixes 'XYZIN' and
> 'XYZOUT'. Below is an example:
>
> pdbset XYZIN input.pdb XYZOUT output.pdb
>
> So far I have,
>
> local expl
> _description files expl 'pdb files'
> _path_files "$expl[@]" -g '*.pdb' || _path_files "$expl[@]" -/ -g
> '*.pdb'
>
> I am having trouble inserting the prefixes.
> Help is greatly appreciated.
>
> Wataru Kagawa
>
Messages sorted by:
Reverse Date,
Date,
Thread,
Author