diff options
Diffstat (limited to 'functions/rc.sh')
-rw-r--r-- | functions/rc.sh | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/functions/rc.sh b/functions/rc.sh index 12444d1..0c14035 100644 --- a/functions/rc.sh +++ b/functions/rc.sh @@ -49,7 +49,8 @@ ebegin() # eend() { - GENFUN_CALLER=${GENFUN_CALLER:-eend} _eend eerror "$@" + : "${genfun_caller:=eend}" + _eend eerror "$@" } # @@ -161,7 +162,8 @@ ewarnn() # ewend() { - GENFUN_CALLER=${GENFUN_CALLER:-ewend} _eend ewarn "$@" + : "${genfun_caller:=ewend}" + _eend ewarn "$@" } # @@ -240,7 +242,8 @@ done veend() { if yesno "${EINFO_VERBOSE}"; then - GENFUN_CALLER=veend eend "$@" + genfun_caller=veend + eend "$@" elif [ "$#" -gt 0 ] && { ! is_int "$1" || [ "$1" -lt 0 ]; }; then _warn_for_args veend "$1" false @@ -252,7 +255,8 @@ veend() vewend() { if yesno "${EINFO_VERBOSE}"; then - GENFUN_CALLER=vewend ewend "$@" + genfun_caller=vewend + ewend "$@" elif [ "$#" -gt 0 ] && { ! is_int "$1" || [ "$1" -lt 0 ]; }; then _warn_for_args vewend "$1" false @@ -311,7 +315,7 @@ _eend() if [ "$#" -eq 0 ]; then retval=0 elif ! is_int "$1" || [ "$1" -lt 0 ]; then - _warn_for_args "${GENFUN_CALLER}" "$1" + _warn_for_args "${genfun_caller}" "$1" retval=1 msg= else @@ -320,6 +324,8 @@ _eend() msg=$* fi + genfun_caller= + if [ "${retval}" -ne 0 ]; then # If a message was given, print it with the specified function. if _is_visible "${msg}"; then |