diff --git a/cv b/cv index 2250c06..d6bc59d 100755 --- a/cv +++ b/cv @@ -1,6 +1,6 @@ #!/bin/bash -w=10 +w=11 dfmt="+%Y-%m-%d" ex(){ @@ -10,7 +10,7 @@ ex(){ [ -z $date ] && date=$(date $dfmt) [ -z $ydate ] && ydate=$(date -d yesterday $dfmt) title(){ - local w=36 + local w=39 printf "║ %-${w}s ║\n" "${*}" } @@ -46,28 +46,28 @@ out(){ } frame(){ case "$1" in - top) printf "╔══════════════════════════════════════╗\n" ;; - table) printf "║ Statistic ║ Today ║ Yesterday ║\n" - printf "╟────────────╫────────────╫────────────╢\n" ;; - up) printf "╠════════════╦════════════╦════════════╣\n" ;; - down) printf "╚════════════╩════════════╩════════════╝\n" ;; - line) printf "╠════════════╩════════════╩════════════╣\n" ;; - bot) printf "╚══════════════════════════════════════╝\n" ;; + top) printf "╔═════════════════════════════════════════╗\n" ;; + table) printf "║ Statistic ║ Today ║ Yesterday ║\n" + printf "╟─────────────╫─────────────╫─────────────╢\n" ;; + up) printf "╠═════════════╦═════════════╦═════════════╣\n" ;; + down) printf "╚═════════════╩═════════════╩═════════════╝\n" ;; + line) printf "╠═════════════╩═════════════╩═════════════╣\n" ;; + bot) printf "╚═════════════════════════════════════════╝\n" ;; esac } result(){ frame up frame table out Total cases - out "╰> Per 1M" casesPerOneMillion + out "╰> Per 1M " casesPerOneMillion out Active active out Critical critical out New todayCases out Deaths deaths - out "╰> Per 1M" deathsPerOneMillion + out "╰> Per 1M " deathsPerOneMillion out Recovered recovered out Tests tests - out "╰> Per 1M" testsPerOneMillion + out "╰> Per 1M " testsPerOneMillion getpct testsPerOneMillion if [ ! -f $data/$ydate-$country ] || [ $(get todayCases) == "0" ] then @@ -106,18 +106,19 @@ frame top title "Queried at: $date" if [ ! -z "$country" ] then + # This is to be phased out in favor of worldwide stats + # in the else statement. if [ "$country" == "all" ] then endpoint=all + country=world result else endpoint=countries/$country result fi else - # Change this to your own country as desired. - country=Belgium - title "Country has been set to $country." - endpoint=countries/$country + endpoint=all + country=world result fi