From: Mario Lang <mlang@home.delysid.org>
To: zsh-workers@sunsite.dk
Subject: Completing option/value pairs without space
Date: 21 Mar 2001 17:56:31 +0100 [thread overview]
Message-ID: <87ae6ff4cg.fsf@home.delysid.org> (raw)
Hello.
I am currently defining a _ecasound autoload function.
A typical command line of ecasound looks like this:
ecasound -d:3 -a:1 -i myfile.wav -efs:100,50 -kl:1,100,5000,10 -a:all -o /dev/dsp
relevant parts of the manpage are:
NAME
ecasound - sample editor, multitrack recorder, fx-proces-
sor, etc.
SYNOPSIS
ecasound [ general_options ] { [ chain_setup ] [
effect_setup ] [ input_setup ] [ output_setup ] }
OPTIONS
Notice that the order of parameters given on the command
line is important!
GLOBAL OPTIONS
-d:debug_level
Set the debug level to 'debug_level'. This a bit-
masked value, that defaults to 3. See ECA_DEBUG
class documentation for more detailed info about
various debug_level values.
GENERAL
-a:chainname1, chainname2, ...
Select active signal chains. All effects, inputs
and outputs are assigned to these chains. If there
are no -a options given, default chain is used.
Chain name 'all' is reserved and means that all
chains are selected. By giving multiple -a options,
you can control to which chains effects, inputs and
outputs are assigned to. Look at the EXAMPLES sec-
tion for more detailed info about the usage of this
option.
EFFECT SETUP
FILTER EFFECTS
-efs:center-freq,width
Resonator. 'center_freq' is the center frequency.
Width is specified in Hz. Basicly just another res-
onating bandpass filter.
For the rest of the stuff, go figure.
I tried to use the _arguments function, but I came across
a problem which someone here perhaps can cast a little light on:
The colon and the comma should be regarded as separators.
Here is my current code:
#compdef ecasound
local context state line
typeset -A opt_args
_arguments \
'-c[Start in interactive mode]' \
'-d\:[Debug level]:Debug level:' \
'-D[Print all debug information to stderr]' \
'-q[Quiet mode, no output]' \
'--help[Show help]' \
'--version[Show version information]' \
'-n\:[Set the name of chainsetup]' \
'-s\:[Create a new chainsetup from file]:filename:_files' \
'-sr\:[Set internal sampling rate]:Sampling rate:(8000 11025 22050 44100 48000)'
When I now e.g. do:
ecasound -sr:<TAB>
i get a space, and when hitting tab again, I get the sampling rates for completion.
The same problem would strike when I come to the more complicated
effects. e.g. I would like to have:
ecasound ... -efs:<TAB>
and get
-efs: -- Resonator center freq
and when doing
ecasound ... -efs:100,<TAB>
Id like to get
-efs:*, -- resonator width
And a really reall neat(tm) gadget would be:
ecasound ... -efs:100,50 -kl:<TAB>
should give
-kl:1 -- Linear controller controlling Resonator freq
-kl:2 -- Linear controller controlling Resonator width
and so on.
Is this possible with current completion system?
Ecasound has so many different command line parameters that
such type of completion would be necessary. Otherwise the completion
for ecasoud will not improve usability a lot...
Any hints here?
--
CYa,
Mario <mlang@delysid.org>
Homepage(s): http://delysid.org | http://piss.at/
next reply other threads:[~2001-03-21 16:57 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-03-21 16:56 Mario Lang [this message]
2001-03-22 9:27 Sven Wischnowsky
2001-03-22 23:29 ` Mario Lang
2001-03-24 15:03 ` Oliver Kiddle
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=87ae6ff4cg.fsf@home.delysid.org \
--to=mlang@home.delysid.org \
--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).