Separate show and title functions
This commit is contained in:
parent
75dd29e52d
commit
902d6a9ad7
12
cv
12
cv
@ -7,6 +7,9 @@ ex(){
|
||||
date=$(date +"%Y-%m-%d")
|
||||
ydate=$(date -d yesterday +"%Y-%m-%d")
|
||||
show(){
|
||||
echo -e "\\033[0;36m> ${*} \\033[0m"
|
||||
}
|
||||
title(){
|
||||
w=36
|
||||
printf "║ %-${w}s ║\n" "${*}"
|
||||
}
|
||||
@ -15,10 +18,7 @@ data="$HOME/Documents/cv"
|
||||
[ ! -d "$data" ] && ex "mkdir -p $data"
|
||||
|
||||
# If not set by an environment variable, set country to $1.
|
||||
if [ -z "$country" ]
|
||||
then
|
||||
country=$1
|
||||
fi
|
||||
[ -z "$country" ] && country=$1
|
||||
|
||||
get(){
|
||||
if [ -f "$data/$date-$country" ]
|
||||
@ -82,7 +82,7 @@ result(){
|
||||
}
|
||||
|
||||
frame top
|
||||
show "Queried at: $date"
|
||||
title "Queried at: $date"
|
||||
if [ ! -z "$country" ]
|
||||
then
|
||||
if [ "$country" == "all" ]
|
||||
@ -96,7 +96,7 @@ then
|
||||
else
|
||||
# Change this to your own country as desired.
|
||||
country=Belgium
|
||||
show "Country has been set to $country."
|
||||
title "Country has been set to $country."
|
||||
endpoint=countries/$country
|
||||
result
|
||||
fi
|
||||
|
Reference in New Issue
Block a user