From: Jesse W <jessw@netwood.net>
To: zsh-workers@sunsite.dk
Subject: PATCH: metaflac completion
Date: Mon, 17 Jul 2006 15:26:11 -0700 [thread overview]
Message-ID: <839a001951e139f1c79f13dd7253d7ef@netwood.net> (raw)
[-- Attachment #1: Type: text/plain, Size: 943 bytes --]
I've written a first version of a z shell completion function for the
FLAC metadata editing program, metaflac; right now it doesn't complete
any of the option arguments that arn't files, but it handles the
various options, and handles looking only for FLAC files (with the -g
option of _files). This will be more or less my first zsh completion
function, so any suggestions would be greatly appreciated.
I plan to implement completion for the tag options, so that, i.e.
`metaflac foo.flac --show-tag=` would automatically get a list of the
tags in the file in the background and complete their names at that
point; also, I'd hope the --set-tag= option would have a preset range
of tags to set.
My eventual goal is to make metaflac (with zsh completion) into a
more-or-less comfortable FLAC metadata editor.
The file is attached. If the mailing system mucks it up, it's also
available at
http://netwood.net/usr/jessw/_metaflac
[-- Attachment #2: _metaflac --]
[-- Type: application/octet-stream, Size: 1670 bytes --]
#compdef metaflac
#Written by Jesse Weinstein <jessw@netwood.net>, Mon Jul 17 15:17:12 2006
#Version 0.3 - doesn't handle non-file option arguments yet.
#Released under the MIT license (or any compatible free-content license)
#i.e. do whatever you like with it, but credit me.
local _metaflac_opts _metaflac_shorts _metaflac_opers
typeset -A opt_args
function _metaflac_tags () {
echo "\n\nBEEP - $line - BEEP\n\n"
}
_metaflac_opts=(
'--preserve-modtime'
'--with-filename[prefix output with filename]'
'--no-filename'
'--dont-use-padding[always rewrite the file]'
)
_metaflac_shorts=(
'--show-md5sum'
'--show-min-blocksize'
'--show-max-blocksize'
'--show-min-framesize'
'--show-max-framesize'
'--show-sample-rate'
'--show-channels'
'--show-bps'
'--show-total-samples'
'--show-vendor-tag'
'--show-tag=:FLAC tags:_metaflac_tags'
'--remove-tag=:FLAC tags: '
'--remove-first-tag=:FLAC tags: '
'--remove-all-tags'
'--set-tag=:FLAC tag and value: '
'--import-tags-from=:flat file:_files'
'--export-tags-to=:new file: '
'--import-cuesheet-from=:file:_files'
'--export-cuesheet-to=:new file: '
'--add-replay-gain'
'--add-seekpoint=:: '
'--add-padding=length'
)
_metaflac_opers=(
'--block-number=:: '
'--block-type=:: '
'--except-block-type=:: '
'--application-data-format=:: '
'--remove'
'--remove-all'
'--merge-padding'
'--sort-padding'
)
_arguments "$_metaflac_opts[@]" \
"*:FLAC file:_files -g \*.flac" \
- "shortcuts" \
"$_metaflac_shorts[@]" \
- "(operations)" \
"$_metaflac_opers[@]" \
&& return 0
reply other threads:[~2006-07-17 22:40 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=839a001951e139f1c79f13dd7253d7ef@netwood.net \
--to=jessw@netwood.net \
--cc=zsh-workers@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).