summaryrefslogtreecommitdiff
path: root/git-sh-setup.sh
diff options
context:
space:
mode:
authorStephen Boyd <bebarino@gmail.com>2009-06-16 15:32:59 -0700
committerJunio C Hamano <gitster@pobox.com>2009-06-18 09:50:31 -0700
commite064c170b4abe21f50658f2ec3b07e4ec7520767 (patch)
treef708a00a1ce96521669037aea192e1c1c7bf3346 /git-sh-setup.sh
parent3ddd170323fcf24af8c4a321ed9c73cda532986e (diff)
downloadgit-e064c170b4abe21f50658f2ec3b07e4ec7520767.tar.gz
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 <bebarino@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git-sh-setup.sh')
-rwxr-xr-xgit-sh-setup.sh9
1 files changed, 9 insertions, 0 deletions
diff --git a/git-sh-setup.sh b/git-sh-setup.sh
index 80acb7de72..c41c2f7439 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