Make the code a bit cleaner

This commit is contained in:
Michael De Roover 2020-08-10 17:10:13 +02:00
parent 59b3d56a94
commit 07d9734ba0
Signed by: vim
GPG Key ID: 075496E232CE04CB
1 changed files with 4 additions and 13 deletions

17
cv
View File

@ -56,6 +56,8 @@ frame(){
esac
}
result(){
frame top
title "Queried at: $date"
frame up
frame table
out Total cases
@ -102,21 +104,10 @@ then
ydate=$(date -d "2 days ago" $dfmt)
fi
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
endpoint=countries/$country
result
else
endpoint=all
country=world