status() did stdout/stderr redirection to /dev/null when calling the given command since the very beginning (commit fd8fde03). This is not as flexible and intuitive as it could be. It is much better to do redirection when calling when/where ever wanted. --- functions | 11 +++++++---- 1 files changed, 7 insertions(+), 4 deletions(-) diff --git a/functions b/functions index 38d7054..440ed31 100644 --- a/functions +++ b/functions @@ -153,14 +153,17 @@ stat_die() { exit ${1:-1} } +# Avoid stolen messages if status() is called with stdout redirection +exec {RC_FUNCTIONS_STDOUT_FD}>&1 + status() { - stat_busy "$1" + stat_busy "$1" >&${RC_FUNCTIONS_STDOUT_FD} shift - if "$@" &>/dev/null; then - stat_done + if "$@"; then + stat_done >&${RC_FUNCTIONS_STDOUT_FD} return 0 fi - stat_fail + stat_fail >&${RC_FUNCTIONS_STDOUT_FD} return 1 } -- 1.7.1