step/level,index,label
This commit is contained in:
parent
8875d08a2e
commit
76937bc1bf
1 changed files with 9 additions and 4 deletions
13
spcd/main.sh
13
spcd/main.sh
|
@ -872,19 +872,22 @@ ${SPCD_PYTHON_ALIAS} / ${spcd_stp__name}"
|
|||
|
||||
spcd_step() {
|
||||
if [ -n "${1}" ]; then
|
||||
eval "SPCD_STEP_${SPCD_STEP}=\"${1}\""
|
||||
spcd_step__prefix="SPCD_STEP_${SPCD_STEP_LEVEL}"
|
||||
spcd_step__index="${spcd_step__prefix}_INDEX"
|
||||
eval "${spcd_step__index}=$((${spcd_step__index} + 1))"
|
||||
eval "${spcd_step__prefix}_LABEL=\"${1}\""
|
||||
spcd_banner
|
||||
fi
|
||||
}
|
||||
|
||||
spcd_step_in() {
|
||||
SPCD_STEP=$((SPCD_STEP + 1))
|
||||
SPCD_STEP_LEVEL=$((SPCD_STEP_LEVEL + 1))
|
||||
spcd_step_wipe
|
||||
}
|
||||
|
||||
spcd_step_out() {
|
||||
spcd_step_wipe
|
||||
SPCD_STEP=$((SPCD_STEP - 1))
|
||||
SPCD_STEP_LEVEL=$((SPCD_STEP_LEVEL - 1))
|
||||
}
|
||||
|
||||
# ╭───────────╮
|
||||
|
@ -1201,7 +1204,9 @@ spcd_banner_unset() {
|
|||
SPCD_STEP=1
|
||||
|
||||
spcd_step_wipe() {
|
||||
eval "unset SPCD_STEP_${SPCD_STEP}"
|
||||
unset \
|
||||
"SPCD_STEP_${SPCD_STEP_LEVEL}_INDEX" \
|
||||
"SPCD_STEP_${SPCD_STEP_LEVEL}_LABEL"
|
||||
}
|
||||
|
||||
# ╭──────────╮
|
||||
|
|
Loading…
Reference in a new issue