Hi,

When the command 'md5sum -c longlist --quiet' would result
in the message "WARNING: 1 line is improperly formatted",
then the subsequent command to find out which line is wrong
'md5sum -c longlist --quiet --warn' results in an unexpected
barrage of output.  It would be much nicer if --warn did not
undo the effect of --quiet, so the report of the misformatted
line does not get swamped in a long list of okays.  Attached
first patch makes this change.

(To be fully logical, the above probably has to be extended
to make --status always override --warn and --quiet and not
be overridden by them, otherwise the order '--warn --status
--quiet' would do something else than '--quiet --status 
--warn'.)

The second patch improves the description of '--warn'.  In
my opinion the option is always useful, not only when just a
few lines are misformatted -- and it would be handy if it were
the default.

By the way, why is there a short option for --warn, but not
for --quiet and --status?

Regards,

Benno

-- 
http://www.fastmail.fm - Send your email first class

From 600424f36d056388eab2c5fa9df1eaa79bc686b2 Mon Sep 17 00:00:00 2001
From: Benno Schulenberg <[email protected]>
Date: Tue, 19 Oct 2010 22:21:21 +0200
Subject: [PATCH 1/2] md5sum: make the options --warn and --quiet orthogonal

* src/md5sum.c (main): Allow --warn and --quiet to both be true;
the most useful combination when checking a long list of files.
---
 src/md5sum.c |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/src/md5sum.c b/src/md5sum.c
index a660e3b..0b8a20e 100644
--- a/src/md5sum.c
+++ b/src/md5sum.c
@@ -646,11 +646,9 @@ main (int argc, char **argv)
       case 'w':
         status_only = false;
         warn = true;
-        quiet = false;
         break;
       case QUIET_OPTION:
         status_only = false;
-        warn = false;
         quiet = true;
         break;
       case_GETOPT_HELP_CHAR;
-- 
1.6.3.3

From f330a66ec22b3698ec9c24f76c1e3d58d8b5f9e6 Mon Sep 17 00:00:00 2001
From: Benno Schulenberg <[email protected]>
Date: Tue, 19 Oct 2010 23:09:55 +0200
Subject: [PATCH 2/2] md5sum: remove strange sentence from description of --warn

* doc/coreutils (md5sum invocation): Improve the explanation of --warn.
---
 doc/coreutils.texi |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/doc/coreutils.texi b/doc/coreutils.texi
index 4d17ed1..3585062 100644
--- a/doc/coreutils.texi
+++ b/doc/coreutils.texi
@@ -3517,9 +3517,8 @@ terminal.
 @opindex -w
 @opindex --warn
 @cindex verifying MD5 checksums
-When verifying checksums, warn about improperly formatted MD5 checksum lines.
-This option is useful only if all but a few lines in the checked input
-are valid.
+When verifying checksums, warn about each improperly formatted MD5
+checksum line, including the line number in the message.
 
 @end table
 
-- 
1.6.3.3

Reply via email to