allowed variable length width

pull/2/head
Hari Sekhon 7 years ago
parent 817f31dc16
commit a08beb06ac

@ -26,6 +26,6 @@ set -euo pipefail
textsize=${#1}
# I want this to only match my hr() function, not 27" iMac 5K screens
#width=$(tput cols)
width=80
width="${2:-${WIDTH:-80}}"
span=$((($width + $textsize) / 2))
printf "%${span}s\n" "$1"

Loading…
Cancel
Save