[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 7/8] cksum: add --algorithm option to select digest mode
From: |
Jim Meyering |
Subject: |
Re: [PATCH 7/8] cksum: add --algorithm option to select digest mode |
Date: |
Wed, 8 Sep 2021 12:43:16 +0200 |
Re this:
+#if HASH_ALGO_CKSUM
+ /* TODO: Remove these restrictions. */
+ switch (cksum_algorithm)
+ {
+ case bsd:
+ case sysv:
+ case crc:
+ if (delim != '\n')
+ die (EXIT_FAILURE, 0,
+ _("--zero is not supported with --algorithm={bsd,sysv,crc}"));
+ if (prefix_tag)
+ die (EXIT_FAILURE, 0,
+ _("--tag is not supported with --algorithm={bsd,sysv,crc}"));
+ if (do_check)
+ die (EXIT_FAILURE, 0,
+ _("--check is not supported with --algorithm={bsd,sysv,crc}"));
+ break;
+ default:
+ break;
+ }
I like the new table-driven code. Thanks!
Depending on when you want to address that TODO, you may want to
diagnose multiple errors before exiting, so as to diagnose two or
three errors when using more than one of these: --zero --tag --check
- [PATCH 3/8] digest: refactor sum(1) into digest.c, (continued)
- [PATCH 3/8] digest: refactor sum(1) into digest.c, Pádraig Brady, 2021/09/07
- [PATCH 8/8] digest: add support for sm3, Pádraig Brady, 2021/09/07
- [PATCH 6/8] digest: refactor cksum(1) into digest.c, Pádraig Brady, 2021/09/07
- [PATCH 7/8] cksum: add --algorithm option to select digest mode, Pádraig Brady, 2021/09/07
- Re: [PATCH 7/8] cksum: add --algorithm option to select digest mode,
Jim Meyering <=
- Re: [PATCH 7/8] cksum: add --algorithm option to select digest mode, Pádraig Brady, 2021/09/08
- Re: Add support for cksum --algorithm [sm3], Jim Meyering, 2021/09/08
- Re: Add support for cksum --algorithm [sm3], Michael Stone, 2021/09/08