From 1c1813148b8ea57a2852322260469f6f5190d676 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Fri, 23 Aug 2024 23:06:10 +0200 Subject: [PATCH] spcd_banner --- spcd/main.sh | 29 +++++++++++++++++++++-------- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/spcd/main.sh b/spcd/main.sh index a816a7f..4042412 100644 --- a/spcd/main.sh +++ b/spcd/main.sh @@ -827,6 +827,23 @@ ${SPCD_PYTHON_ALIAS} / ${spcd_stp__name}" # functions +spcd_banner() { + unset SPCD_BANNER_1 SPCD_BANNER_2 SPCD_BANNER_3 + spcd_banner_add_123 "${SPCD_DOWN}" "${SPCD_VERT}" "${SPCD___UP}" + # + spcd_banner__index="${SPCD_STEP}" + [ -n "${SPCD_SUBSTEP}" ] && + spcd_banner__index="${spcd_banner__index}.${SPCD_SUBSTEP}" + spcd_banner_add "${spcd_banner__index}" + # + for spcd_banner__item in "${SPCD_STEP_TEXT}" "${SPCD_SUBSTEP_TEXT}"; do + spcd_banner_add_123 "┬" "${SPCD_VERT}" "┴" + spcd_banner_add "${spcd_banner__item}" + done + # + spcd_banner_add_123 "╮" "${SPCD_VERT}" "╯" +} + spcd_banner_add() { if [ -n "${1}" ]; then spcd_ba__text=" ${1} " @@ -1002,18 +1019,14 @@ spcd_split() { spcd_step() { SPCD_STEP=$((SPCD_STEP + 1)) SPCD_STEP_TEXT="${*}" - unset SPCD_SUBSTEP - spcd_banner "${SPCD_STEP}" "${SPCD_VERT}" "${SPCD_STEP_TEXT}" + unset SPCD_SUBSTEP SPCD_SUBSTEP_TEXT + spcd_banner } spcd_substep() { SPCD_SUBSTEP=$((SPCD_SUBSTEP + 1)) - spcd_banner \ - "${SPCD_STEP}.${SPCD_SUBSTEP}" \ - "${SPCD_VERT}" \ - "${SPCD_STEP_TEXT}" \ - "${SPCD_VERT}" \ - "${*}" + SPCD_SUBSTEP_TEXT="${*}" + spcd_banner } spcd_write() {