From: Stephen Boyd Date: Tue, 16 Jun 2009 22:32:59 +0000 (-0700) Subject: git-sh-setup: introduce say() for quiet options X-Git-Tag: v1.6.4-rc0~27^2~3 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=e064c170b4abe21f50658f2ec3b07e4ec7520767;p=git.git 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 --- 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