Re: [PATCHv2 1/3] git-sh-setup: introduce say() for quiet options
- From
Thomas Adam <thomas.adam22@gmail.com>
- Date
- Jun 14, 2009, 23:21 UTC
- Message-ID
- <18071eea0906141621t676a965aqc3056b481b8e8796@mail.gmail.com>
- In-Reply-To
- <1245021374-8430-2-git-send-email-bebarino@gmail.com>
2009/6/15 Stephen Boyd <bebarino@gmail.com>:
Show 21 quoted lines
> 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 <bebarino@gmail.com>
> ---
> 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 "$@"Except that where you've then replaced various calls with say() they were originally using printf. Please use printf here also, and not echo.
-- Thomas Adam