From e064c170b4abe21f50658f2ec3b07e4ec7520767 Mon Sep 17 00:00:00 2001 From: Stephen Boyd Date: Tue, 16 Jun 2009 15:32:59 -0700 Subject: [PATCH] git-sh-setup: introduce say() for quiet options Scripts should use say() when they want to output non-error messages. This function helps future script writers easily implement a quiet option by setting GIT_QUIET to enable suppression of non-error messages. Signed-off-by: Stephen Boyd Signed-off-by: Junio C Hamano --- git-sh-setup.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/git-sh-setup.sh b/git-sh-setup.sh index 80acb7de7..c41c2f743 100755 --- a/git-sh-setup.sh +++ b/git-sh-setup.sh @@ -44,6 +44,15 @@ die() { exit 1 } +GIT_QUIET= + +say () { + if test -z "$GIT_QUIET" + then + printf '%s\n' "$*" + fi +} + if test -n "$OPTIONS_SPEC"; then usage() { "$0" -h -- 2.30.2