[FFmpeg-cvslog] configure: Print large lists in more columns if the screen size allows

Timothy Gu git at videolan.org
Thu Sep 17 01:22:33 CEST 2015


ffmpeg | branch: master | Timothy Gu <timothygu99 at gmail.com> | Mon Sep 14 16:34:50 2015 -0700| [712235dd8fb354101d8b35c4a9b2cbc9b24dd2d9] | committer: Timothy Gu

configure: Print large lists in more columns if the screen size allows

Reviewed-by: Ganesh Ajjanagadde <gajjanag at mit.edu>
Reviewed-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=712235dd8fb354101d8b35c4a9b2cbc9b24dd2d9
---

 configure |   16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/configure b/configure
index 2fb625b..839c85d 100755
--- a/configure
+++ b/configure
@@ -425,7 +425,10 @@ if test -t 1 && which tput >/dev/null; then
         error_color=$(tput setaf 1)
         reset_color=$(tput sgr0)
     fi
+    # 72 used instead of 80 since that's the default of pr
+    ncols=$(tput cols)
 fi
+: ${ncols:=72}
 
 log(){
     echo "$@" >> $logfile
@@ -3041,14 +3044,15 @@ die_unknown(){
     exit 1
 }
 
-print_3_columns() {
-    cat | tr ' ' '\n' | sort | pr -r -3 -t
+print_in_columns() {
+    cols=$(expr $ncols / 24)
+    cat | tr ' ' '\n' | sort | pr -r "-$cols" -w $ncols -t
 }
 
 show_list() {
     suffix=_$1
     shift
-    echo $* | sed s/$suffix//g | print_3_columns
+    echo $* | sed s/$suffix//g | print_in_columns
     exit 0
 }
 
@@ -5969,17 +5973,17 @@ test -n "$random_seed" &&
 echo
 
 echo "Enabled programs:"
-print_enabled '' $PROGRAM_LIST | print_3_columns
+print_enabled '' $PROGRAM_LIST | print_in_columns
 echo
 
 echo "External libraries:"
-print_enabled '' $EXTERNAL_LIBRARY_LIST | print_3_columns
+print_enabled '' $EXTERNAL_LIBRARY_LIST | print_in_columns
 echo
 
 for type in decoder encoder hwaccel parser demuxer muxer protocol filter bsf indev outdev; do
     echo "Enabled ${type}s:"
     eval list=\$$(toupper $type)_LIST
-    print_enabled '_*' $list | print_3_columns
+    print_enabled '_*' $list | print_in_columns
     echo
 done
 



More information about the ffmpeg-cvslog mailing list