Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: MPlayer completion fonction
- X-seq: zsh-workers 16386
- From: Oliver Kiddle <okiddle@xxxxxxxxxxx>
- To: Bruno Bonfils <asyd@xxxxxxxxxxxxx>
- Subject: Re: MPlayer completion fonction
- Date: Wed, 02 Jan 2002 18:12:25 +0000
- Cc: zsh-workers@xxxxxxxxxx
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- References: <20011230161538.GA5145@xxxxxxxxxxxxx>
- Sender: kiddleo@xxxxxxxxxxxxxxxxx
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/
Messages sorted by:
Reverse Date,
Date,
Thread,
Author