spcd_banner_add_index
This commit is contained in:
parent
eb843769dd
commit
30e4f3c75d
1 changed files with 17 additions and 17 deletions
34
spcd/main.sh
34
spcd/main.sh
|
@ -1119,7 +1119,7 @@ SPCD_BANNER_VERTICAL="│"
|
|||
|
||||
spcd_banner() {
|
||||
spcd_banner_unset
|
||||
spcd_banner_add "$(spcd_banner_index)"
|
||||
spcd_banner_add_index
|
||||
spcd_banner_add "S"
|
||||
#
|
||||
for spcd_banner__item in "${SPCD_STEP_TEXT}" "${SPCD_SUBSTEP_TEXT}"; do
|
||||
|
@ -1150,6 +1150,22 @@ spcd_banner_add() {
|
|||
fi
|
||||
}
|
||||
|
||||
spcd_banner_add_index() {
|
||||
unset spcd_bi__label
|
||||
unset spcd_bi__level
|
||||
while true; do
|
||||
spcd_bi__level=$((spcd_bi__level + 1))
|
||||
eval "spcd_bi__value=\"\${SPCD_BANNER_${spcd_bi__level}_INDEX}\""
|
||||
[ -n "${spcd_bi__value}" ] || break
|
||||
if [ -n "${spcd_bi__label}" ]; then
|
||||
spcd_bi__label="${spcd_bi__label}.${spcd_bi__value}"
|
||||
else
|
||||
spcd_bi__label="${spcd_bi__value}"
|
||||
fi
|
||||
done
|
||||
spcd_banner_add "${spcd_bi__label}"
|
||||
}
|
||||
|
||||
spcd_banner_append() {
|
||||
if [ -n "${3}" ]; then
|
||||
SPCD_BANNER_TOP="${SPCD_BANNER_TOP}${1}"
|
||||
|
@ -1172,22 +1188,6 @@ ${SPCD_BANNER_MIDDLE}
|
|||
${SPCD_BANNER_BOTTOM}"
|
||||
}
|
||||
|
||||
spcd_banner_index() {
|
||||
unset spcd_bi__label
|
||||
unset spcd_bi__level
|
||||
while true; do
|
||||
spcd_bi__level=$((spcd_bi__level + 1))
|
||||
eval "spcd_bi__value=\"\${SPCD_BANNER_${spcd_bi__level}_INDEX}\""
|
||||
[ -n "${spcd_bi__value}" ] || break
|
||||
if [ -n "${spcd_bi__label}" ]; then
|
||||
spcd_bi__label="${spcd_bi__label}.${spcd_bi__value}"
|
||||
else
|
||||
spcd_bi__label="${spcd_bi__value}"
|
||||
fi
|
||||
done
|
||||
echo "${spcd_bi__label}"
|
||||
}
|
||||
|
||||
spcd_banner_open() {
|
||||
spcd_banner_append \
|
||||
"${SPCD_BANNER_DOWN_AND_RIGHT}" \
|
||||
|
|
Loading…
Reference in a new issue