bug-coreutils
[Top][All Lists]
Advanced

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

Re: [PATCH] Standardize some error messages.


From: Jim Meyering
Subject: Re: [PATCH] Standardize some error messages.
Date: Fri, 04 Apr 2008 18:38:41 +0200

"Bo Borgerson" <address@hidden> wrote:
> This may be too small to bother with (if so I'll know next time), but
> I was reading standards.txt, and noticed the following in section 4.4
> on formatting error messages:
>
> ----
>    The string MESSAGE should not begin with a capital letter when it
> follows a program name and/or file name, because that isn't the
> beginning of a sentence.  (The sentence conceptually starts at the
> beginning of the line.)  Also, it should not end with a period.
> ----
>
> Which rang a bell from a section of src/wc.c I was reading yesterday
> that I happened to notice ended an error message with a period.
>
> So I ran the following in src:
>
> $ grep error *.c | perl -e '/"[A-Z]|\."/ and print while (<STDIN>);'
>
> and found a few more, which I changed to conform to the format
> specified in standards.txt.
>
> I also noticed that there were several instances of messages starting
> with 'WARNING:', or 'FATAL:', and two instances of 'Warning:'.  The
> standards don't seem to mention any convention there, but I changed
> the 'Warning' cases to 'WARNING', just for consistency.
>
> This may be a case of historical behavior being the best convention,
> as I'm sure there are users out there parsing error output from these
> utilities and relying on the current messages (I had to change two
> tests that were doing just that).  If not, please see the attached
> patch.

Thanks.  I'll be happy to apply that.
Though I have to wait for your copyright paperwork to go through.
Have you received/sent the paper yet?

Please remove the #FIXME comment, now that you've fixed it ;-)

>     # FIXME: should be lower case "invalid".
>     ['inv-pg-range', "--pages=9x", {EXIT => 1},
> -    {ERR=>"$prog: Invalid page range `9x'\n"}],
> +    {ERR=>"$prog: invalid page range `9x'\n"}],
>    );
>
>  my $save_temps = $ENV{DEBUG};

Global changes like this are useful, but they're
worth a lot more if accompanied by a rule (I put them
in the file now named maint.mk) that automatically
enforces the policy from now on.

So how about adding an sc_*** rule for this in maint.mk?




reply via email to

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