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