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>
This commit is contained in:

committed by
Junio C Hamano

parent
3ddd170323
commit
e064c170b4
@ -44,6 +44,15 @@ die() {
|
|||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
GIT_QUIET=
|
||||||
|
|
||||||
|
say () {
|
||||||
|
if test -z "$GIT_QUIET"
|
||||||
|
then
|
||||||
|
printf '%s\n' "$*"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
if test -n "$OPTIONS_SPEC"; then
|
if test -n "$OPTIONS_SPEC"; then
|
||||||
usage() {
|
usage() {
|
||||||
"$0" -h
|
"$0" -h
|
||||||
|
Reference in New Issue
Block a user