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() { _spcd_banner_add() {
if [ -n "${1}" ]; then if [ -n "${1}" ]; then
spcd_ba__text=" ${1} " local text=" ${1} "
spcd_ba__length=${#spcd_ba__text} local length=${#text}
spcd_ba__filler="$( local filler="$(_spcd_fill "${length}" "${_SPCD_BANNER_HORIZONTAL}")"
_spcd_fill "${spcd_ba__length}" "${_SPCD_BANNER_HORIZONTAL}"
)"
if [ -n "${__SPCD_BANNER_MIDDLE}" ]; then if [ -n "${__SPCD_BANNER_MIDDLE}" ]; then
_spcd_banner_split _spcd_banner_split
else else
_spcd_banner_open _spcd_banner_open
fi fi
_spcd_banner_append \ _spcd_banner_append "${filler}" "${text}" "${filler}"
"${spcd_ba__filler}" "${spcd_ba__text}" "${spcd_ba__filler}"
fi fi
} }