From b552224354ba44e7a615e80b1f1173b015bbc832 Mon Sep 17 00:00:00 2001 From: Andrew Robbins Date: Fri, 22 Feb 2019 00:47:19 -0500 Subject: Don't output header/footer to stderr unless necessary --- libs/tool | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'libs/tool') diff --git a/libs/tool b/libs/tool index 2732238a..be28129c 100755 --- a/libs/tool +++ b/libs/tool @@ -97,19 +97,21 @@ tool_action() { return 0 fi - printf 1>&2 '%s\n' "Tool $tool $action (with ${arguments:-no argument})" + printf '%s\n' "Tool $tool $action (with ${arguments:-no argument})" ( set -e + "$action" "$@" ) if [[ $? -ne 0 ]] then printf 1>&2 '\n%s\n' "Tool $tool $action (with ${arguments:-no argument}) failed" + return 1 else - printf 1>&2 '\n%s\n' "Tool $tool $action (with ${arguments:-no argument}) completed" + printf '\n%s\n' "Tool $tool $action (with ${arguments:-no argument}) completed" fi ) } -- cgit v1.2.3-70-g09d2