The name can now be a standard shell pattern. For example,
--disable-encoder=* disables all encoders.
Originally committed as revision 19603 to svn://svn.ffmpeg.org/ffmpeg/trunk
... | ... |
@@ -290,6 +290,14 @@ sh_quote(){ |
290 | 290 |
echo "$v" |
291 | 291 |
} |
292 | 292 |
|
293 |
+filter(){ |
|
294 |
+ pat=$1 |
|
295 |
+ shift |
|
296 |
+ for v; do |
|
297 |
+ case "$v" in $pat) echo "$v" ;; esac |
|
298 |
+ done |
|
299 |
+} |
|
300 |
+ |
|
293 | 301 |
set_all(){ |
294 | 302 |
value=$1 |
295 | 303 |
shift |
... | ... |
@@ -1383,10 +1391,9 @@ for opt do |
1383 | 1383 |
;; |
1384 | 1384 |
--enable-*=*|--disable-*=*) |
1385 | 1385 |
eval $(echo "$opt" | sed 's/=/-/;s/--/action=/;s/-/ thing=/;s/-/ name=/') |
1386 |
- case "$thing" in |
|
1387 |
- encoder|decoder|hwaccel|muxer|demuxer|indev|outdev|parser|bsf|protocol|filter) $action ${optval}_${thing} ;; |
|
1388 |
- *) die_unknown "$opt" ;; |
|
1389 |
- esac |
|
1386 |
+ is_in "${thing}s" $COMPONENT_LIST || die_unknown "$opt" |
|
1387 |
+ eval list=\$$(toupper $thing)_LIST |
|
1388 |
+ $action $(filter "${optval}_${thing}" $list) |
|
1390 | 1389 |
;; |
1391 | 1390 |
--enable-?*|--disable-?*) |
1392 | 1391 |
eval $(echo "$opt" | sed 's/--/action=/;s/-/ option=/;s/-/_/g') |