summaryrefslogtreecommitdiff
path: root/git-sh-setup.sh
diff options
context:
space:
mode:
authorStephen Boyd <bebarino@gmail.com>2009-06-16 22:32:59 (GMT)
committerJunio C Hamano <gitster@pobox.com>2009-06-18 16:50:31 (GMT)
commite064c170b4abe21f50658f2ec3b07e4ec7520767 (patch)
treef708a00a1ce96521669037aea192e1c1c7bf3346 /git-sh-setup.sh
parent3ddd170323fcf24af8c4a321ed9c73cda532986e (diff)
downloadgit-e064c170b4abe21f50658f2ec3b07e4ec7520767.zip
git-e064c170b4abe21f50658f2ec3b07e4ec7520767.tar.gz
git-e064c170b4abe21f50658f2ec3b07e4ec7520767.tar.bz2
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 80acb7d..c41c2f7 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