* Dynamic completion question
@ 2006-07-24 5:10 Jesse W
0 siblings, 0 replies; only message in thread
From: Jesse W @ 2006-07-24 5:10 UTC (permalink / raw)
To: zsh-users
I'm working on adding the ability to handle FLAC tags dynamically with
the completion I wrote; I've got something that *mostly* works.
function _metaflac_tags () {
local foo bar
foo=$(metaflac $line[1] --export-tags-to=-) #Gets a list of the
tags (and their values)
bar=("${(@)${(f)foo}%[=]*}") #Cuts the list into an array just of
the tag names (what I want)
compadd -a bar -X "Existing tags"
}
This is called from:
_arguments '--show-tag=:FLAC tags:_metaflac_tags'
My questions are, first, is this the right way to do this? Should I
use some utility function instead? (maybe _alternatives or something?)
Second, assuming this *is* the right way to do this, how do I get a
neat looking description line, like I get for all the other argument
completions? I assume I'm pre-empting it with my call to compadd,
somehow, but I don't understand how this is happening.
Suggestions greatly appreciated!
Jesse Weinstein
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2006-07-24 5:44 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-07-24 5:10 Dynamic completion question Jesse W
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).