Skip to content

mbo/digest: --check mode for the digest CLI#233

Merged
helly25 merged 1 commit into
mainfrom
digest/cli-check
Jul 5, 2026
Merged

mbo/digest: --check mode for the digest CLI#233
helly25 merged 1 commit into
mainfrom
digest/cli-check

Conversation

@helly25

@helly25 helly25 commented Jul 5, 2026

Copy link
Copy Markdown
Owner

Implements the verification half of the checksum workflow (the unscheduled idea from TODO):

  • -c/--check: arguments become checksum files (- = stdin); every listed file is re-digested with the selected -a algorithm and reported OK / FAILED / FAILED open or read, with coreutils-style stderr warnings and exit codes.
  • Interop both directions, verified live: shasum -a 256 output checks clean under digest -c, and digest output checks clean under shasum -c -. Accepts * binary markers and uppercase hex.
  • Companions: --quiet (no OK lines), --status (exit code only), --ignore_missing (skip unreadable listed files; still fails if no file was verified), --strict (improperly formatted lines fail).
  • The algorithm stays explicit via -a - hash length cannot disambiguate (32 bytes could be sha256, sha3-256, blake2b-256, or blake3).
  • bashtest: roundtrip (file + stdin), coreutils-format acceptance, corruption detection, quiet/status behavior, missing/ignore-missing incl. the no-file-verified case, and strict. Docs/CHANGELOG updated; the idea is struck from the TODO list.

-c/--check verifies checksum files: OK/FAILED per listed file,
coreutils-style warnings and exit codes; accepts '*' binary markers and
uppercase hex, so sum files are interchangeable with sha256sum/shasum in
both directions (verified live). Companions: --quiet, --status,
--ignore_missing (fails if nothing was verified), --strict (malformed
lines fail). bashtest covers roundtrip, stdin, coreutils format,
corruption, quiet/status, missing/ignore-missing, and strict.
@helly25 helly25 requested a review from Fab-Cat July 5, 2026 08:40
@helly25 helly25 merged commit 0316af7 into main Jul 5, 2026
40 checks passed
@helly25 helly25 deleted the digest/cli-check branch July 5, 2026 09:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants