Improve out function

This commit is contained in:
Michael De Roover 2020-07-03 19:55:42 +02:00
parent 340065b607
commit 1288bea0ed
Signed by: vim
GPG Key ID: 075496E232CE04CB

5
cv
View File

@ -48,7 +48,8 @@ out(){
w=10
if [ -z $3 ]
then
printf "%-${w}s %d \t+ %d\n" "$1:" "$(get $2)" "$(expr $(get $2) - $(yget $2))"
printf "%-${w}s %-${w}s" "$1:" "$(get $2)" "+ $(expr $(get $2) - $(yget $2))"
printf "\n"
else
printf "%-${w}s %d\n" "$1:" "$(yget $2)"
fi
@ -63,8 +64,6 @@ result(){
out Tests tests
if [ -f "$data/$ydate-$country" ]
then
show "Yesterday's stats:"
out New todayCases yesterday
if [ "$(get todayCases)" == "$(yget todayCases)" ]
then
show "Seems like the stats are the same as yesterday."