[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] md5sum+sha*sum: add option --quiet/-q to suppress OK message
From: |
Jim Meyering |
Subject: |
Re: [PATCH] md5sum+sha*sum: add option --quiet/-q to suppress OK messages |
Date: |
Sun, 01 Jun 2008 16:51:43 +0200 |
Erik Auerswald <address@hidden> wrote:
> And here it is... (attached).
Thanks.
Here are some minor changes I expect to "amend" into your patch.
They alphabetize lists, tweak wording and correct a comment.
Plus, in NEWS (as in ChangeLog/commit log), it's good to list all
program names explicitly, rather than abbreviating like sha*sum.
diff --git a/NEWS b/NEWS
index 194dde8..b12631b 100644
--- a/NEWS
+++ b/NEWS
@@ -4,8 +4,8 @@ GNU coreutils NEWS -*-
outline -*-
** New features
- md5sum and sha*sum now know an option --quiet to suppress the printing
- of 'OK' messages.
+ md5sum now accepts the new option, --quiet, to suppress the printing of
+ 'OK' messages. sha1sum, sha224sum, sha384sum, and sha512sum accept it, too.
* Noteworthy changes in release 6.12 (2008-05-31) [stable]
diff --git a/doc/coreutils.texi b/doc/coreutils.texi
index 21ed1c0..e804d58 100644
--- a/doc/coreutils.texi
+++ b/doc/coreutils.texi
@@ -3277,6 +3277,15 @@ an MD5 checksum inconsistent with the associated file,
or if no valid
line is found, @command{md5sum} exits with nonzero status. Otherwise,
it exits successfully.
address@hidden --quiet
address@hidden --quiet
address@hidden verifying MD5 checksums
+This option is useful only when verifying checksums.
+When verifying checksums, don't generate an 'OK' message per successfully
+checked file. Files that fail the verification are reported in the
+default one-line-per-file format. If there is any checksum mismatch,
+print a warning summarizing the failures to standard error.
+
@itemx --status
@opindex --status
@cindex verifying MD5 checksums
@@ -3289,15 +3298,6 @@ If all listed files are readable and are consistent with
the associated
MD5 checksums, exit successfully. Otherwise exit with a status code
indicating there was a failure.
address@hidden --quiet
address@hidden --quiet
address@hidden verifying MD5 checksums
-This option is useful only when verifying checksums.
-When verifying checksums, don't generate an 'OK' message per successfully
-checked file. Files that fail the verification are reported in the
-default one-line-per-file format. If any files failed verification,
-a warning summarizing any failures is printed to standard error.
-
@item -t
@itemx --text
@opindex -t
diff --git a/src/md5sum.c b/src/md5sum.c
index 5fe17c5..c0b5ed5 100644
--- a/src/md5sum.c
+++ b/src/md5sum.c
@@ -117,7 +117,7 @@ static bool status_only = false;
improperly formatted checksum line. */
static bool warn = false;
-/* With --quiet, don't print a message for successfully verified files */
+/* With --check, suppress the "OK" printed for each verified file. */
static bool quiet = false;
/* The name this program was run with. */
@@ -135,10 +135,10 @@ static const struct option long_options[] =
{
{ "binary", no_argument, NULL, 'b' },
{ "check", no_argument, NULL, 'c' },
+ { "quiet", no_argument, NULL, QUIET_OPTION },
{ "status", no_argument, NULL, STATUS_OPTION },
{ "text", no_argument, NULL, 't' },
{ "warn", no_argument, NULL, 'w' },
- { "quiet", no_argument, NULL, QUIET_OPTION },
{ GETOPT_HELP_OPTION_DECL },
{ GETOPT_VERSION_OPTION_DECL },
{ NULL, 0, NULL, 0 }
@@ -183,8 +183,8 @@ With no FILE, or when FILE is -, read standard input.\n\
fputs (_("\
\n\
The following three options are useful only when verifying checksums:\n\
+ --quiet don't print OK for each successfully verified file\n\
--status don't output anything, status code shows success\n\
- --quiet no output for successfully verified files\n\
-w, --warn warn about improperly formatted checksum lines\n\
\n\
"), stdout);