🔨 Three columns in mftest menu
This commit is contained in:
parent
c06a183f28
commit
61c000d96f
@ -206,13 +206,26 @@ fi
|
|||||||
if [[ $TESTENV == '-' ]]; then
|
if [[ $TESTENV == '-' ]]; then
|
||||||
IND=0
|
IND=0
|
||||||
NAMES=()
|
NAMES=()
|
||||||
|
MENU=()
|
||||||
|
BIGLEN=0
|
||||||
for FILE in $( ls -1 $TESTPATH/* )
|
for FILE in $( ls -1 $TESTPATH/* )
|
||||||
do
|
do
|
||||||
let IND++
|
let IND++
|
||||||
TNAME=${FILE/$TESTPATH\//}
|
TNAME=${FILE/$TESTPATH\//}
|
||||||
NAMES+=($TNAME)
|
NAMES+=($TNAME)
|
||||||
(( IND < 10 )) && echo -n " "
|
IFS=""
|
||||||
echo " $IND) $TNAME"
|
ITEM=$( printf "%2i) %s" $IND $TNAME )
|
||||||
|
MENU+=($ITEM)
|
||||||
|
[[ ${#ITEM} -gt $BIGLEN ]] && BIGLEN=${#ITEM}
|
||||||
|
done
|
||||||
|
|
||||||
|
(( BIGLEN += 2 ))
|
||||||
|
THIRD=$(( (${#MENU[@]} + 2) / 3 ))
|
||||||
|
for ((i = 0; i < $THIRD; i++))
|
||||||
|
do
|
||||||
|
COL1=$i ; COL2=$(( $i + $THIRD )) ; COL3=$(( $i + 2 * $THIRD ))
|
||||||
|
FMT="%-${BIGLEN}s"
|
||||||
|
printf "${FMT}${FMT}${FMT}\n" ${MENU[$COL1]} ${MENU[$COL2]} ${MENU[$COL3]}
|
||||||
done
|
done
|
||||||
|
|
||||||
echo
|
echo
|
||||||
|
Loading…
Reference in New Issue
Block a user