From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28114 invoked from network); 21 Mar 2001 16:57:59 -0000 Received: from sunsite.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 21 Mar 2001 16:57:59 -0000 Received: (qmail 16687 invoked by alias); 21 Mar 2001 16:57:42 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 13691 Received: (qmail 16660 invoked from network); 21 Mar 2001 16:57:37 -0000 To: zsh-workers@sunsite.dk Subject: Completing option/value pairs without space From: Mario Lang Date: 21 Mar 2001 17:56:31 +0100 Message-ID: <87ae6ff4cg.fsf@home.delysid.org> User-Agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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: 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: and get -efs: -- Resonator center freq and when doing ecasound ... -efs:100, Id like to get -efs:*, -- resonator width And a really reall neat(tm) gadget would be: ecasound ... -efs:100,50 -kl: 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 Homepage(s): http://delysid.org | http://piss.at/