Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Conflict between *:foo:_files and -o:bar:_files
- X-seq: zsh-users 12692
- From: Haakon Riiser <haakon.riiser@xxxxxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: Conflict between *:foo:_files and -o:bar:_files
- Date: Fri, 7 Mar 2008 14:33:23 +0100
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
I'm writing a completer for a program that can be called both as
$ app input -o output
or
$ app -o output input
For this, I've tried
_arguments -S \
'-o:output file:_files' \
'*:input file:_files'
For some reason, calling the app as
$ app input -o <PRESS-TAB-HERE>
and then using ZSH's completion system to generate alternatives
for -o, the _files completer is called twice with two different
descriptions:
output file
file1 file2 file3 (etc)
input file
file1 file2 file3 (etc)
I can "fix" this by changing the descriptions for -o and * to be the
same, e.g.
_arguments -S \
'-o:file:_files' \
'*:file:_files'
I'm sure there is a better way, and I hope someone here can point me
in the right direction.
BTW: You can reproduce the bug (?) using the gcc completer:
gcc foo.c -o <PRESS-TAB-HERE>
This results in the same kind of output as I showed above.
--
Haakon
Messages sorted by:
Reverse Date,
Date,
Thread,
Author