Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Minor glitch with misuse of _describe; doc?
- X-seq: zsh-workers 31788
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Minor glitch with misuse of _describe; doc?
- Date: Fri, 04 Oct 2013 07:42:56 -0700
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
I was fiddling with trying to get multiple completion tag groups to all
align their match/description separators in a neat column, and wrote
this little (broken) completer:
_describe_t ()
{
local -a commands extra
commands=('one:command one' 'two:command two')
extra=('extraone:extra command one'
'zbiggertoshowthealignissue:extra command two')
_describe -t commands 'commands' commands -- -t extra 'extra' extra
}
compdef _describe_t zzz
Got this very unexpected result:
torch% zzz <TAB>
- extra
-2V extraone
-a -J
_a_13 _tmpd
-d _tmpm
-D zbiggertoshowthealignissue
-default-
one # command one
two # command two
The correct usage is (I think)
_describe -t commands 'commands' commands -- extra
(that is, you can't repeat the "-t tag description" part after the "--")
but something about throwing too many arguments after the "--" causes a
bunch of internal bits of _describe to show up as possible completions.
What exactly are the "completion options OPTS" that can be passed through
_describe as mentioned in the manual?
_describe [ -oO | -t TAG ] DESCR NAME1 [ NAME2 ] OPTS ... -- ...
This function associates completions with descriptions. Multiple
groups separated by -- can be supplied, potentially with different
completion options OPTS.
I think perhaps that should say "compadd options"?
(Same for _combination ?)
Messages sorted by:
Reverse Date,
Date,
Thread,
Author