Clean up frame function

This commit is contained in:
Michael De Roover 2020-08-14 19:54:24 +02:00
parent 731c9fd800
commit 8e101a2413
Signed by: vim
GPG Key ID: 075496E232CE04CB
1 changed files with 9 additions and 9 deletions

18
cv
View File

@ -1,7 +1,7 @@
#!/bin/bash
# Variable declarations go here.
w=14
w=15
dfmt="+%Y-%m-%d"
data="$HOME/Documents/cv"
country=$1
@ -18,7 +18,7 @@ fi
# Functions go here.
title(){
local w=48
local w=51
printf "║ %-${w}s ║\n" "${*}"
}
@ -32,7 +32,7 @@ get(){
fi
}
getpm(){
out "╰> Per 1M " "$(get $1) ($(echo "$(bc <<< "scale = 1; $(get $1) / 10000")%"))" ""
out "╰> Per 1M " "$(get $1) ($(echo "$(bc <<< "scale = 1; $(get $1) / 10000")%"))" ""
}
yget(){
date=$ydate
@ -51,12 +51,12 @@ out(){
}
frame(){
case "$1" in
top) printf "╔══════════════════════════════════════════════════╗\n" ;;
sep) printf "╟────────────────╫────────────────╫────────────────╢\n" ;;
up) printf "╠════════════════╦════════════════╦════════════════╣\n" ;;
down) printf "╚════════════════╩════════════════╩════════════════╝\n" ;;
line) printf "╠════════════════╩════════════════╩════════════════╣\n" ;;
bot) printf "╚══════════════════════════════════════════════════╝\n" ;;
top) printf "╔ %-${w}s ═ %-${w}s ═ %-${w}s ╗\n" | sed "s/\ /═/g" ;;
sep) printf "╟ %-${w}s ╫ %-${w}s ╫ %-${w}s ╢\n" | sed "s/\ /─/g" ;;
up) printf "╠ %-${w}s ╦ %-${w}s ╦ %-${w}s ╣\n" | sed "s/\ /═/g" ;;
down) printf "╚ %-${w}s ╩ %-${w}s ╩ %-${w}s ╝\n" | sed "s/\ /═/g" ;;
line) printf "╠ %-${w}s ╩ %-${w}s ╩ %-${w}s ╣\n" | sed "s/\ /═/g" ;;
bot) printf "╚ %-${w}s ═ %-${w}s ═ %-${w}s ╝\n" | sed "s/\ /═/g" ;;
esac
}
result(){