coreutils
[Top][All Lists]
Advanced

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

Re: RFE: hash-type in sum utils


From: Ondrej Oprala
Subject: Re: RFE: hash-type in sum utils
Date: Thu, 23 Aug 2012 11:06:30 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:14.0) Gecko/20120717 Thunderbird/14.0

On 08/23/2012 10:36 AM, Pádraig Brady wrote:
On 08/23/2012 08:55 AM, Ondrej Oprala wrote:
On 08/22/2012 06:38 PM, Jim Meyering wrote:
Eric Blake wrote:
On 08/22/2012 10:05 AM, Pádraig Brady wrote:
On 08/22/2012 03:00 PM, Ondrej Oprala wrote:
Hi, I haven't heard from this thread since I posted the last patch,
are there still things to correct or should I consider it closed?
The --tag description in the texinfo is a bit sparse.  It says:

"If the file is not binary, put a leading whitespace before the
algorithm's name."

More accurately it could say:

"When operating in @option{--text} mode, put a leading space before
the algorithm's name.
On @option{--text} mode significant systems, this enables
compatibility with existing
BSD (binary) checksums, while also allowing operating in @option{--text} mode".

It's worth considering though, do we want to support --text mode
at all with --tag?  I.E. we could avoid the default leading space,
and have --tag imply --binary and be mutually exclusive with --text?
I'm fine with --tag implying --binary.  --text mode is almost always the
wrong thing to use, and it should have never been the default on
text-mode systems, nor should it be the default output (we're stuck with
that for normal output, where the presence of '*' to indicate binary
output, but only from systems where text mode differs, causes no end of
grief; but for BSD output we don't have to repeat the mistake).

I'm 60:40 for having --tag imply --binary given the above.
I'm 90:10 for having --tag imply --binary.
I agree wholeheartedly.  Simpler is better.

Ok, I'm almost done with the changes, I just have one question.
What should the sum utils do if they get --tag --text as arguments?
Would it be possible to add BOOL TEXT and end with an error
if(text && prefix_tag) ?
Yes, if both are specified it should do something like:

if (prefix_tag && text)
   {
     /* This could be supported in a backwards compatible way
        by prefixing the output line with a space in text mode.
        However that's invasive enough that it was agreed to
        not support this mode with --tag, as --text use cases
        are adequately supported by the default output format.  */
     error(0, 0, _("--tag does not support --text mode"));
     usage (EXIT_FAILURE);
   }

thanks!
Pádraig.
Alright then, I've redone the tests, made the news and coreutils.texi
entry a bit more verbose, redone the utils to work in binary mode with
--tag specified and added the check in case both TAG and TEXT are given
as arguments.
Cheers,
 Ondrej.

Attachment: DIFF
Description: Text document


reply via email to

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