From: Jesse W <jessw@netwood.net>
To: zsh-users@sunsite.dk
Subject: Dynamic completion question
Date: Sun, 23 Jul 2006 22:10:22 -0700 [thread overview]
Message-ID: <1384623ea383e482ce2731af9dde8343@netwood.net> (raw)
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
reply other threads:[~2006-07-24 5:44 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1384623ea383e482ce2731af9dde8343@netwood.net \
--to=jessw@netwood.net \
--cc=zsh-users@sunsite.dk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).