Thread (10 messages) flat view 10 messages, 3 authors, 2016-06-15

[PATCHv2 1/3] git-sh-setup: introduce say() for quiet options

From: Stephen Boyd <hidden>
Date: 2016-06-15 22:46:57
Subsystem: the rest · Maintainer: Linus Torvalds

Scripts should use say() when they want to echo to stdout. Setting
GIT_QUIET will mute say(), allowing scripts to easily implement a quiet
option.

Signed-off-by: Stephen Boyd <redacted>
---
 git-sh-setup.sh |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/git-sh-setup.sh b/git-sh-setup.sh
index 80acb7d..f88184e 100755
--- a/git-sh-setup.sh
+++ b/git-sh-setup.sh
@@ -44,6 +44,13 @@ die() {
 	exit 1
 }
 
+say () {
+	if test -z "$GIT_QUIET"
+	then
+		echo "$@"
+	fi
+}
+
 if test -n "$OPTIONS_SPEC"; then
 	usage() {
 		"$0" -h
-- 
1.6.3.2.306.g4f4fa
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help