[Top][All Lists]
[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
> +}
- Re: [PATCH] bootstrap: use a more consistent error reporting scheme., (continued)
- Re: [PATCH] bootstrap: use a more consistent error reporting scheme., Jim Meyering, 2012/07/06
- Re: [PATCH] bootstrap: use a more consistent error reporting scheme., Akim Demaille, 2012/07/06
- Re: [PATCH] bootstrap: use a more consistent error reporting scheme., Jim Meyering, 2012/07/06
- Re: [PATCH] bootstrap: use a more consistent error reporting scheme., Akim Demaille, 2012/07/06
- Re: [PATCH] bootstrap: use a more consistent error reporting scheme., Jim Meyering, 2012/07/06
- Re: [PATCH] bootstrap: use a more consistent error reporting scheme., Bruce Korb, 2012/07/06
- Re: [PATCH] bootstrap: use a more consistent error reporting scheme., Eric Blake, 2012/07/09
- Re: [PATCH] bootstrap: use a more consistent error reporting scheme., Eric Blake, 2012/07/09
- Re: [PATCH] bootstrap: use a more consistent error reporting scheme., Jim Meyering, 2012/07/10
- Re: [PATCH] bootstrap: use a more consistent error reporting scheme., Akim Demaille, 2012/07/10
- Re: [PATCH] bootstrap: use a more consistent error reporting scheme.,
Jim Meyering <=
- Re: [PATCH] bootstrap: use a more consistent error reporting scheme., Akim Demaille, 2012/07/10
- Re: [PATCH] bootstrap: use a more consistent error reporting scheme., Jim Meyering, 2012/07/10
- Re: [PATCH] bootstrap: use a more consistent error reporting scheme., Akim Demaille, 2012/07/10
- Re: [PATCH] bootstrap: use a more consistent error reporting scheme., Jim Meyering, 2012/07/10
- Re: [PATCH] bootstrap: use a more consistent error reporting scheme., Akim Demaille, 2012/07/06
- Re: [PATCH] bootstrap: use a more consistent error reporting scheme., Stefano Lattarini, 2012/07/06
- Re: [PATCH] bootstrap: use a more consistent error reporting scheme., Akim Demaille, 2012/07/06
- Re: [PATCH] bootstrap: use a more consistent error reporting scheme., Stefano Lattarini, 2012/07/06
- Re: [PATCH] bootstrap: use a more consistent error reporting scheme., Akim Demaille, 2012/07/06
- Re: [PATCH] bootstrap: use a more consistent error reporting scheme., Jim Meyering, 2012/07/06