Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Passsing descriptions down in completion functions
- X-seq: zsh-workers 18062
- From: Borzenkov Andrey <Andrey.Borzenkov@xxxxxxxxxxx>
- To: "'zsh-workers@xxxxxxxxxx'" <zsh-workers@xxxxxxxxxx>
- Subject: Passsing descriptions down in completion functions
- Date: Thu, 9 Jan 2003 16:17:07 +0300
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
Either I do not understand something basic or it does not work (and probably
has never working really).
Simple example.
bor@itsrm2% functions _foo
_foo () {
_arguments -s "-p[some option]:argument for this option:_hosts"
}
bor@itsrm2% compdef _foo foo
bor@itsrm2% foo -p TAB
bor@itsrm2% foo -p D248H032
Completing host
^^^^ should it not be "argument for that option"?
D248H032 GH4090Y0 anyhost
...
It is clear what happens:
+_arguments:340> _hosts -J option-p-1 -X '%BCompleting argument for this
option%b'
this sounds good, but later on ...
+_all_labels:37> compadd -J hosts -X '%BCompleting host%b' -M
'm:{a-zA-Z}={A-Za-z} r:|.=* r:|=*' -J option-p-1 -X '%BCompleting argument
for this option%b' -a hosts
Oops, description is now lost.
Quoting documentation:
If the ACTION starts
with a space, this list of words will be invoked unchanged,
otherwise it will be invoked with some extra strings placed after
the first word which can be given as arguments to the compadd
builtin command and which make sure that the MESSAGE given in the
description will be shown above the matches.
So, is it a bug or not?
-andrej
Messages sorted by:
Reverse Date,
Date,
Thread,
Author