about summary refs log tree commit diff
path: root/Completion/Unix/Command
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2010-09-16 12:20:00 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2010-09-16 12:20:00 +0000
commitdd061dc2ce8aed2145c00c620a541be2b0d92784 (patch)
tree3385ceec6464b31ef7798370855c9741f221fb24 /Completion/Unix/Command
parent24869e5426d6cc12a1cc9a41c26904656628d88b (diff)
downloadzsh-dd061dc2ce8aed2145c00c620a541be2b0d92784.tar.gz
zsh-dd061dc2ce8aed2145c00c620a541be2b0d92784.tar.xz
zsh-dd061dc2ce8aed2145c00c620a541be2b0d92784.zip
Baptiste: 28264: remove the need for sed from _ffmpeg
Diffstat (limited to 'Completion/Unix/Command')
-rw-r--r--Completion/Unix/Command/_ffmpeg10
1 files changed, 5 insertions, 5 deletions
diff --git a/Completion/Unix/Command/_ffmpeg b/Completion/Unix/Command/_ffmpeg
index 7c0660ed1..1c57e3b9c 100644
--- a/Completion/Unix/Command/_ffmpeg
+++ b/Completion/Unix/Command/_ffmpeg
@@ -18,24 +18,24 @@ _ffmpeg_presets() {
 
 _ffmpeg_acodecs() {
     local acodecs
-    acodecs=($(ffmpeg -codecs 2>/dev/null | sed -n '/^ .[E ]A/ {s/^ .......//; s/ .*//p;}'))
+    acodecs=(${${(M)${(f)"$(ffmpeg -codecs 2>/dev/null)"}:#[[:space:]][D[:space:]][E[:space:]]A[S[:space:]][D[:space:]][T[:space:]][[:space:]][^[:space:]]##*}//(#b)????????([^[:space:]]##)*/$match[1]})
     _ffmpeg_compadd 'force audio codec (''copy'' to copy stream)' acodecs ''
 }
 
 _ffmpeg_vcodecs() {
     local vcodecs
-    vcodecs=($(ffmpeg -codecs 2>/dev/null | sed -n '/^ .[E ]V/ {s/^ .......//; s/ .*//p;}'))
+    vcodecs=(${${(M)${(f)"$(ffmpeg -codecs 2>/dev/null)"}:#[[:space:]][D[:space:]][E[:space:]]V[S[:space:]][D[:space:]][T[:space:]][[:space:]][^[:space:]]##*}//(#b)????????([^[:space:]]##)*/$match[1]})
     _ffmpeg_compadd 'force video codec (''copy'' to copy stream)' vcodecs ''
 }
 
 _ffmpeg_formats() {
     local formats
-    formats=($(ffmpeg -formats 2>/dev/null | sed -e '1,/--/d' -e 's/^....//' -e 's/ .*//' | tr , '\n' | sort | uniq))
+    formats=(${(ou)${=${(s:,:)${${(M)${(f)"$(ffmpeg -formats 2>/dev/null)"}:#[[:space:]][D[:space:]][E[:space:]][[:space:]][^[:space:]]##*}//(#b)????([^[:space:]]##)*/$match[1]}}}})
     _ffmpeg_compadd 'force format' formats ''
 }
 
 _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]}
 }
 
 _ffmpeg_pix_fmts() {
@@ -46,7 +46,7 @@ _ffmpeg_pix_fmts() {
 
 _ffmpeg_bsfs() {
     local bsfs
-    bsfs=($(ffmpeg -bsfs 2>/dev/null | sed 1d))
+    bsfs=(${${(f)"$(ffmpeg -bsfs 2>/dev/null)"}:#*:})
     _ffmpeg_compadd 'set bitstream filter' bsfs ''
 }