banner/add

This commit is contained in:
Marc Beninca 2024-08-31 00:57:21 +02:00
parent 3634ea4a77
commit 835ad7279c
Signed by: marc.beninca
GPG key ID: 9C7613450C80C24F

View file

@ -27,18 +27,15 @@ _SPCD_BANNER_VERTICAL="│"
_spcd_banner_add() {
if [ -n "${1}" ]; then
spcd_ba__text=" ${1} "
spcd_ba__length=${#spcd_ba__text}
spcd_ba__filler="$(
_spcd_fill "${spcd_ba__length}" "${_SPCD_BANNER_HORIZONTAL}"
)"
local text=" ${1} "
local length=${#text}
local filler="$(_spcd_fill "${length}" "${_SPCD_BANNER_HORIZONTAL}")"
if [ -n "${__SPCD_BANNER_MIDDLE}" ]; then
_spcd_banner_split
else
_spcd_banner_open
fi
_spcd_banner_append \
"${spcd_ba__filler}" "${spcd_ba__text}" "${spcd_ba__filler}"
_spcd_banner_append "${filler}" "${text}" "${filler}"
fi
}