bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] bootstrap: use a more consistent error reporting scheme.


From: Jim Meyering
Subject: Re: [PATCH] bootstrap: use a more consistent error reporting scheme.
Date: Tue, 10 Jul 2012 10:14:37 +0200

Akim Demaille wrote:
> Here is an updated proposal, that was taking into account
> several comments made last week.

Looks fine, modulo a question and test artifacts:
Thanks!

...
> -warn()
> +# warnf_ FORMAT-STRING ARG1...
> +warnf_ ()
>  {
> -  for i
> -  do
> -    echo "$i"
> -  done | sed -e "s/^/$me: /" >&2
> +  warnf_format_=$1
> +  shift
> +  nl='
> +'
> +  case $* in
> +    *$nl*) me_=$(printf "$me"|tr "$nl|" '??')

Is it worth testing for both $nl and '|' ?

> +       printf "$warnf_format_" "$@" | sed "s|^|$me_: |" ;;
> +    *) printf "$me: $warnf_format_" "$@" ;;
> +  esac >&2
> +}
> +
> +warnf_ '<%s>\n' "test1" 't
> +e
> +d
> +2' t3 t54

No test artifacts, please ;-)

> +warnf_ ()
> +{
> +  warnf_format_=$1
> +  shift
> +  printf "$warnf_format_" "$@" | sed "s,^,$me: ," >&2
> +}



reply via email to

[Prev in Thread] Current Thread [Next in Thread]