Browse Source

Make debugger pretty

pull/400/head
Curtis Doty 1 year ago
parent
commit
f994433466
No known key found for this signature in database GPG Key ID: 86FEF440C45E065B
  1. 20
      syno_hdd_db.sh

20
syno_hdd_db.sh

@ -197,9 +197,25 @@ else
fi fi
PS4func() {
local lineno="$1"
local i f=''
local c="\033[0;36m" y="\033[0;33m" n="\033[0m"
local d=$((${#FUNCNAME[@]}-2))
if [[ $lineno == 1 ]]
then lineno=0
fi
for ((i=d; i>0; i--))
do printf -v f "%s%s()" "$f" "${FUNCNAME[i]}"
done
printf "$y%s:%04d$c%s$n " "${BASH_SOURCE[1]##*/}" "$lineno" "$f"
}
if [[ $debug == "yes" ]]; then if [[ $debug == "yes" ]]; then
set -x PS4='\r$(PS4func $LINENO)'
export PS4='`[[ $? == 0 ]] || echo "\e[1;31;40m($?)\e[m\n "`:.$LINENO:' set -o xtrace
fi fi

Loading…
Cancel
Save