coreutils
[Top][All Lists]
Advanced

[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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]