Make spacing in output adjustable
This commit is contained in:
parent
11c28758a2
commit
e494d2dada
23
cv
23
cv
@ -44,17 +44,26 @@ yget(){
|
||||
date=$ydate
|
||||
get "$1"
|
||||
}
|
||||
out(){
|
||||
w=10
|
||||
if [ -z $3 ]
|
||||
then
|
||||
printf "%-${w}s %d\n" "$1:" "$(get $2)"
|
||||
else
|
||||
printf "%-${w}s %d\n" "$1:" "$(yget $2)"
|
||||
fi
|
||||
}
|
||||
result(){
|
||||
echo "Total: $(get cases)"
|
||||
echo "Active: $(get active)"
|
||||
echo "New: $(get todayCases)"
|
||||
echo "Deaths: $(get deaths)"
|
||||
echo "Recovered: $(get recovered)"
|
||||
echo "Tests: $(get tests)"
|
||||
out Total cases
|
||||
out Active active
|
||||
out New todayCases
|
||||
out Deaths deaths
|
||||
out Recovered recovered
|
||||
out Tests tests
|
||||
if [ -f "$data/$ydate-$country" ]
|
||||
then
|
||||
show "Yesterday's stats:"
|
||||
echo "New: $(yget todayCases)"
|
||||
out New todayCases yesterday
|
||||
if [ "$(get todayCases)" == "$(yget todayCases)" ]
|
||||
then
|
||||
show "Seems like the stats are the same as yesterday."
|
||||
|
Reference in New Issue
Block a user