md5sum, sha1sum, etc: accept new option: --strict
authorPatrick Schoenfeld <schoenfeld@debian.org>
Thu, 7 Jul 2011 06:57:39 +0000 (08:57 +0200)
committerJim Meyering <meyering@redhat.com>
Thu, 7 Jul 2011 14:42:47 +0000 (16:42 +0200)
commit33171d049a162ca5648c7e213e9c988ea835a19b
tree77022f7d0ceff372e08a61248a97ed7d94441b74
parent88bdce982a99238b5320eca4e19d86fd364419ee
md5sum, sha1sum, etc: accept new option: --strict

Use this new option with --check when the input is expected to
consist solely of checksum lines.  With only --check, an invalid
line evokes a warning, but the program can still exit successfully.
With --strict, any invalid line makes the program exit non-zero.

* src/md5sum.c (strict, STRICT_OPTION): Declare/define.
(long_options): Add "strict".
(usage): Describe --strict.
(digest_check): Count improperly_formatted lines, too, and use
that number and the global "strict" to determine the return value.
(main): Handle STRICT_OPTION.
Reject --strict without --check.
* doc/coreutils.texi: Describe it.
* NEWS (New features): Mention it.
NEWS
doc/coreutils.texi
src/md5sum.c