From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24544 invoked by alias); 16 Sep 2010 12:12:45 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 28264 Received: (qmail 20354 invoked from network); 16 Sep 2010 12:12:43 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received-SPF: pass (ns1.primenet.com.au: SPF record at _spf.google.com designates 74.125.82.171 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:cc:subject :message-id:references:mime-version:content-type:content-disposition :in-reply-to:user-agent; bh=R8JyG1N6IMEWRDQdokoFLGmXY3gG+5TsTMXXvDd8VG8=; b=BJB2vy4WRGaOJi/1IFPwywDWW+PZFld1jvkms/FJNLjxRqJqQDcwPSOJGz5Knlo+Nt HdbR19ZFBPYVbc7JiYKAkQgnxgNff9D0eT8QoycUXVuWMC6XvYC0CnS0RZjzru2hZI/c 3e5vhOT2iWFDdZWL6NDowDBbi4JEhkDE3G2/w= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; b=tMYjqdE47J7aeTg875uKe5cQxwhwfKZEicsy4qxpDyboXVgvzpPYoqS55A83qOEAWv Jm/SDjwTEFcTxTr6qzE7G6qLQiqZZUse0MiS5OkcgvwL8f0HCISkZwcEpAemhjJ+wRIo Rxrh9I1D9lIYqpUmJeRELhVU9jwfNYN63UomQ= Date: Thu, 16 Sep 2010 14:12:35 +0200 From: Bapt To: Peter Stephenson Cc: zsh-workers@zsh.org Subject: Re: [PATCH] remove sed from _ffmpeg Message-ID: <20100916121235.GB33761@azathoth.lan> References: <20100916083831.GA33761@azathoth.lan> <20100916100339.04a0f484@pwslap01u.europe.root.pri> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="d9ADC0YsG2v16Js0" Content-Disposition: inline In-Reply-To: <20100916100339.04a0f484@pwslap01u.europe.root.pri> User-Agent: Mutt/1.5.20 (2009-06-14) --d9ADC0YsG2v16Js0 Content-Type: multipart/mixed; boundary="96YOpH+ONegL0A3E" Content-Disposition: inline --96YOpH+ONegL0A3E Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Sep 16, 2010 at 10:03:39AM +0100, Peter Stephenson wrote: > On Thu, 16 Sep 2010 10:38:31 +0200 > Baptiste Daroussin wrote: > > Here is a patch to remove sed from _ffmpeg. >=20 > I couldn't get this to apply and it looks a bit strange... the altered li= ne > in _ffmpeg_formats doesn't appear to have a command or assignment on it > any more. Sorry I made a mistale in _ffmpeg_formats which is fixed by the following p= atch. The patch is made using the latest git from sourceforge (git diff) regards, Bapt >=20 > --=20 > Peter Stephenson Software Engineer > Tel: +44 (0)1223 692070 Cambridge Silicon Radio Limited > Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ= , UK >=20 >=20 > Member of the CSR plc group of companies. CSR plc registered in England a= nd Wales, registered number 4187346, registered office Churchill House, Cam= bridge Business Park, Cowley Road, Cambridge, CB4 0WZ, United Kingdom --96YOpH+ONegL0A3E Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="_ffmpeg_no_sed.diff" Content-Transfer-Encoding: quoted-printable diff --git a/Completion/Unix/Command/_ffmpeg b/Completion/Unix/Command/_ffm= peg index 7c0660e..1c57e3b 100644 --- a/Completion/Unix/Command/_ffmpeg +++ b/Completion/Unix/Command/_ffmpeg @@ -18,24 +18,24 @@ _ffmpeg_presets() { =20 _ffmpeg_acodecs() { local acodecs - acodecs=3D($(ffmpeg -codecs 2>/dev/null | sed -n '/^ .[E ]A/ {s/^ ....= =2E..//; s/ .*//p;}')) + acodecs=3D(${${(M)${(f)"$(ffmpeg -codecs 2>/dev/null)"}:#[[:space:]][D= [:space:]][E[:space:]]A[S[:space:]][D[:space:]][T[:space:]][[:space:]][^[:s= pace:]]##*}//(#b)????????([^[:space:]]##)*/$match[1]}) _ffmpeg_compadd 'force audio codec (''copy'' to copy stream)' acodecs = '' } =20 _ffmpeg_vcodecs() { local vcodecs - vcodecs=3D($(ffmpeg -codecs 2>/dev/null | sed -n '/^ .[E ]V/ {s/^ ....= =2E..//; s/ .*//p;}')) + vcodecs=3D(${${(M)${(f)"$(ffmpeg -codecs 2>/dev/null)"}:#[[:space:]][D= [:space:]][E[:space:]]V[S[:space:]][D[:space:]][T[:space:]][[:space:]][^[:s= pace:]]##*}//(#b)????????([^[:space:]]##)*/$match[1]}) _ffmpeg_compadd 'force video codec (''copy'' to copy stream)' vcodecs = '' } =20 _ffmpeg_formats() { local formats - formats=3D($(ffmpeg -formats 2>/dev/null | sed -e '1,/--/d' -e 's/^...= =2E//' -e 's/ .*//' | tr , '\n' | sort | uniq)) + formats=3D(${(ou)${=3D${(s:,:)${${(M)${(f)"$(ffmpeg -formats 2>/dev/nu= ll)"}:#[[:space:]][D[:space:]][E[:space:]][[:space:]][^[:space:]]##*}//(#b)= ????([^[:space:]]##)*/$match[1]}}}}) _ffmpeg_compadd 'force format' formats '' } =20 _ffmpeg_list_pix_fmts() { - ffmpeg -pix_fmts 2>/dev/null | sed -e '1,/-----/d' -e 's/^......//' -e= 's/ .*//' + print -l ${${(M)${(f)"$(ffmpeg -pix_fmts 2>/dev/null)"}:#[I.]*}//(#b)?= ?????([^[:space:]]##)*/$match[1]} } =20 _ffmpeg_pix_fmts() { @@ -46,7 +46,7 @@ _ffmpeg_pix_fmts() { =20 _ffmpeg_bsfs() { local bsfs - bsfs=3D($(ffmpeg -bsfs 2>/dev/null | sed 1d)) + bsfs=3D(${${(f)"$(ffmpeg -bsfs 2>/dev/null)"}:#*:}) _ffmpeg_compadd 'set bitstream filter' bsfs '' } =20 --96YOpH+ONegL0A3E-- --d9ADC0YsG2v16Js0 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.16 (FreeBSD) iEYEARECAAYFAkySCbMACgkQ8kTtMUmk6EwvSwCffmGrBhFEYz+7Yb5rbl1W68Ha reMAoIjqbl70P8KIPLNpVKX2H0AuBOPG =ojpU -----END PGP SIGNATURE----- --d9ADC0YsG2v16Js0--