bug-gnulib
[Top][All Lists]
Advanced

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

Re: xstrtol.h


From: Jim Meyering
Subject: Re: xstrtol.h
Date: Sun, 22 Jul 2007 19:20:18 +0200

Ben Pfaff <address@hidden> wrote:
> Jim Meyering <address@hidden> writes:
>> Bruno Haible <address@hidden> wrote:
>>> I can prepare a patch for this; just let me know whether for
>>>    $ od -j -1
>>> you would see the error message
>>>    od: invalid --skip-bytes argument `-1'
>>> or
>>>    od: invalid `-j' argument `-1'
>>
>> You've discovered why the current diagnostics do not mention
>> explicit option strings: hard-coding an option string like --skip-bytes
>> or -j will inevitably be misleading to those who specify the offending
>> argument with the alternative option string.
>
> Would it be reasonable for the message to read as:
>         od: invalid -j or --skip-bytes argument `-1'

A little background on my bias :-)

There's been (at least with coreutils) a long-standing informal policy
to avoid using option strings in diagnostics.  The rationale is that the
messages are usually more readable without them.  Also, the message needn't
change if/when the option name changes.

Also, with the format,

  _("invalid %s argument `%s'")

if the first "%s" can be either "--foo", or "-f or --foo", that seems
like it may lead to translation problems, e.g., if "invalid" and/or
"argument" would have slightly different translations in those two cases.
However, I don't know enough to say for sure.




reply via email to

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