1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 00:17:46 +00:00

checksum: Support the '--check' option

This commit also updates 'checksum' to use the Core::Stream::File API.
This commit is contained in:
implicitfield 2022-10-06 17:29:05 +03:00 committed by Andrew Kaster
parent 340a2a96a4
commit 480e517f03
2 changed files with 82 additions and 18 deletions

View file

@ -4,12 +4,18 @@ checksum - helper program for calculating checksums
## Synopsis
`$ md5sum <file>`
`$ sha1sum <file>`
`$ sha256sum <file>`
`$ sha512sum <file>`
`$ md5sum [options...] <file...>`
`$ sha1sum [options...] <file...>`
`$ sha256sum [options...] <file...>`
`$ sha512sum [options...] <file...>`
## Description
This program calculates and print specified checksum of files. It cannot be run directly, only
as `md5sum`, `sha1sum`, `sha256sum` or `sha512sum`.
as `md5sum`, `sha1sum`, `sha256sum` or `sha512sum`. A non-zero exit code is returned if the
input cannot be read. If the '--check' option is used, a non-zero exit code is also returned
if the checksums cannot be verified.
## Options
* `-c`, `--check`: Verify checksums against `file` or stdin.