From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25983 invoked from network); 2 Jan 2002 18:13:04 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 2 Jan 2002 18:13:04 -0000 Received: (qmail 26816 invoked by alias); 2 Jan 2002 18:12:57 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 16386 Received: (qmail 26804 invoked from network); 2 Jan 2002 18:12:57 -0000 X-VirusChecked: Checked X-Authentication-Warning: iris.logica.co.uk: Host kiddleo@rambo.logica.co.uk [158.234.33.58] claimed to be yahoo.co.uk Sender: kiddleo@iris.logica.co.uk Message-ID: <3C334D89.BBA00062@yahoo.co.uk> Date: Wed, 02 Jan 2002 18:12:25 +0000 From: Oliver Kiddle X-Mailer: Mozilla 4.77 [en] (X11; U; Linux 2.4.16-686-smp i686) X-Accept-Language: en MIME-Version: 1.0 To: Bruno Bonfils CC: zsh-workers@sunsite.dk Subject: Re: MPlayer completion fonction References: <20011230161538.GA5145@debian-fr.org> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Bruno Bonfils wrote: > > i submit you the first completion function for mplayer. I've had a glance and it looks good. > i don't know how to use pattern matching in order to take only > driver of a mplayer -vo help. (how to suppress the first line ?) > if you have an idea... To just suppress the first line, it would be something like ${${(f)"$(mplayer -vo help)"}[2,-1]} but I don't know what the output looks like so I expect Clint's answer will be more useful. > _audio-codec-list () > { > local list > list=(${$(mplayer -ac help | sed '1,7d' | more | awk '{ print $1 }\' )}) > _wanted audio-codec expl 'audio-codec require' compadd $list > } You'll need to declare expl local in these functions too. What is the more command in the pipeline for? You can probably replace the pipeline with some sort of zsh substitution which would be more efficient but less readable. In this case, it'll be something like: list=( ${${(f)"$(mplayer -ac help)"}[8,-1]%% *} ) You can also make it more efficient by using `compadd -a list' > '-ffactor[resample alphmap of the font]:factor:(0 0.75 1 10)' \ typo - should be alphamap > '-skin[skin directory]:skin directory:_path_files -/' \ You might want to look at the _path_files -W option here to complete from within ~/.mplayer/Skin and /usr/local/share/mplayer/Skin. > '-abs[sound carte audio buffer size(in bytes, default: measuring)]' \ wrong language for the word card. > '-display[specify the hostname and display number of the X server]:x-display You can call _x_display to complete display names. Or use _x_arguments instead of _arguments to get a number of common X arguments automatically. > '-fb[specifies the framebuffer device to user]' \ -fb should take a parameter I think for the device. Oliver This email has been scanned for all viruses by the MessageLabs SkyScan service. For more information on a pro-active anti-virus service working around the clock, around the globe visit http://www.messagelabs.com/