From: Pádraig Brady
Date: Sun, 5 Sep 2021 21:07:35 +0000 (+0100) Subject: cksum: document the --debug option X-Git-Tag: v9.0~40 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2aab794c84bac9bfc061c24084e83a75d83156de;p=thirdparty%2Fcoreutils.git cksum: document the --debug option This should have been part of commit v8.32-113-gb73b9fcb1 * doc/coreutils.texi (cksum invocation): Add the --debug description. * src/cksum.c (usage): Likewise. (main): Also give explicit indication when using generic hardware. --- diff --git a/doc/coreutils.texi b/doc/coreutils.texi index 882aa26aba..960df8a355 100644 --- a/doc/coreutils.texi +++ b/doc/coreutils.texi @@ -3949,8 +3949,14 @@ The CRC algorithm is specified by the POSIX standard. It is not compatible with the BSD or System V @command{sum} algorithms (see the previous section); it is more robust. -The only options are @option{--help} and @option{--version}. @xref{Common -options}. +The program accepts the following options. Also see @ref{Common options}. + +@table @samp + +@item --debug +@opindex --debug +Output extra information to stderr, like the checksum implementation being used. +@end table @exitstatus diff --git a/src/cksum.c b/src/cksum.c index 3cc4296bca..9f8b0d8219 100644 --- a/src/cksum.c +++ b/src/cksum.c @@ -344,6 +344,9 @@ Usage: %s [FILE]...\n\ fputs (_("\ Print CRC checksum and byte counts of each FILE.\n\ \n\ +"), stdout); + fputs (_("\ + --debug indicate which implementation used\n\ "), stdout); fputs (HELP_OPTION_DESCRIPTION, stdout); fputs (VERSION_OPTION_DESCRIPTION, stdout); @@ -392,7 +395,10 @@ main (int argc, char **argv) # if USE_PCLMUL_CRC32 if (pclmul_supported ()) cksum_fp = cksum_pclmul; + else # endif /* USE_PCLMUL_CRC32 */ + if (debug) + error (0, 0, "%s", _("using generic hardware support")); if (optind == argc) ok = cksum ("-", false);