Akim Demaille wrote: > Le 6 juil. 2012 à 14:44, Jim Meyering a écrit : >> No, but if you think it's better, somehow... >> I meant that warnf would be a very thin wrapper around printf: >> >> $ printf '%s\n' a b c >> a >> b >> c >> >>> Or should warnf expect a single %s >> >> or multiple %-directives: >> >> $ printf '%s - %s\n' a b c d >> a - b >> c - d > > Ah, I was not aware of this feature, thanks! > Now I see what you mean (thanks to Stefano too :). > > How about this? > > From 96b829fb08217060f20a6a56eddb1a952324fa35 Mon Sep 17 00:00:00 2001 > From: Akim Demaille <a...@lrde.epita.fr> > Date: Fri, 6 Jul 2012 15:01:53 +0200 > Subject: [PATCH] bootstrap: let warn be alike tests/init.sh's warn_
s/alike/like/ > Reported by Jim Meyering. > * build-aux/bootstrap (warn): Remove, replaced by... > (warnf_, warn_): these. > Adjust callers. > Shorten messages that no longer fit in 80 columns. > --- > ChangeLog | 7 +++++++ > build-aux/bootstrap | 41 ++++++++++++++++++++++++++--------------- > 2 files changed, 33 insertions(+), 15 deletions(-) > > diff --git a/ChangeLog b/ChangeLog > index 785f92f..85d8e4d 100644 > --- a/ChangeLog > +++ b/ChangeLog > @@ -1,5 +1,12 @@ > 2012-07-06 Akim Demaille <a...@lrde.epita.fr> > > + bootstrap: let warn be alike tests/init.sh's warn_ s/alike/like/ > + Reported by Jim Meyering. > + * build-aux/bootstrap (warn): Remove, replaced by... > + (warnf_, warn_): these. > + Adjust callers. > + Shorten messages that no longer fit in 80 columns. > + > bootstrap: use a more consistent error reporting scheme > * build-aux/bootstrap (warn, die): New. > Use them. > diff --git a/build-aux/bootstrap b/build-aux/bootstrap > index 1d61e5c..f895e63 100755 > --- a/build-aux/bootstrap > +++ b/build-aux/bootstrap > @@ -1,6 +1,6 @@ > #! /bin/sh > # Print a version string. > -scriptversion=2012-07-06.11; # UTC > +scriptversion=2012-07-06.13; # UTC > > # Bootstrap this package from checked-out sources. > > @@ -77,15 +77,26 @@ Running without arguments will suffice in most cases. > EOF > } > > -warn() > +# warnf_ FORMAT-STRING ARG1... > +warnf_ () > { > - for i > - do > - echo "$i" > - done | sed -e "s/^/$me: /" >&2 > + warnf_format_=$1 > + shift > + printf "$warnf_format_" "$@" | sed "s,^,$me: ," >&2 As Eric suggested, please use "|" in place of each ','. With that and the typo-fix above, ACK.