Columnize stats output

This commit is contained in:
Michael De Roover 2020-07-03 22:26:50 +02:00
parent 25055bf724
commit c12e1f5f46
Signed by: vim
GPG Key ID: 075496E232CE04CB

11
cv
View File

@ -42,13 +42,19 @@ out(){
w=10 w=10
if [ -z $3 ] if [ -z $3 ]
then then
printf "%-${w}s %-${w}s" "$1:" "$(get $2)" "+ $(expr $(get $2) - $(yget $2))" printf "║ %-${w}s ║ %-${w}s ║ %-${w}s ║\n" "$1:" "$(get $2)" "+ $(expr $(get $2) - $(yget $2))"
printf "\n"
else else
printf "%-${w}s %d\n" "$1:" "$(yget $2)" printf "%-${w}s %d\n" "$1:" "$(yget $2)"
fi fi
} }
frame(){
case "$1" in
up) printf "╔════════════╦════════════╦════════════╗\n" ;;
down) printf "╚════════════╩════════════╩════════════╝\n" ;;
esac
}
result(){ result(){
frame up
out Total cases out Total cases
out Active active out Active active
out Critical critical out Critical critical
@ -56,6 +62,7 @@ result(){
out Deaths deaths out Deaths deaths
out Recovered recovered out Recovered recovered
out Tests tests out Tests tests
frame down
if [ -f "$data/$ydate-$country" ] if [ -f "$data/$ydate-$country" ]
then then
if [ "$(get todayCases)" == "$(yget todayCases)" ] if [ "$(get todayCases)" == "$(yget todayCases)" ]