hashsum: Refactor uu_app
to isolate non-"GNU Coreutils" options
#3593
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Several binaries have been added to
hashsum
that have never been partof GNU Coreutils:
sha3*sum
(hashsum: add support for SHA-3 functions #869)shake*sum
(hashsum: implement SHAKE-128 and SHAKE-256 #987)b3sum
(hashsum: Add BLAKE3 to Hashing Algorithms #3108 and Added b2sum and b3sum utility entries #3164)In particular, the
--bits
option, and the--no-names
option added in#3361, are not valid for any GNU Coreutils
*sum
binary(as of Coreutils 9.0).
This commit refactors the argument parsing so that
--bits
and--no-names
become invalid options for the binaries intended to matchthe GNU Coreutils API, instead of being ignored options. It also
refactors the custom binary name handling to distinguish between
binaries intended to match the GNU Coreutils API, and binaries that
don't have that constraint.
Part of #2930.