Skip to content

Commit

Permalink
git-sh-setup: introduce say() for quiet options
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Stephen Boyd authored and Junio C Hamano committed Jun 18, 2009
1 parent 3ddd170 commit e064c17
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions git-sh-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e064c17

Please sign in to comment.