Skip to content

hashsum: Should not accept --strict without --check #6436

@BenWiederhake

Description

@BenWiederhake

--strict without --check is meaningless, and we should raise an error accordingly. Just like GNU does:

$ ../gnu/src/md5sum --strict < /dev/null
../gnu/src/md5sum: the --strict option is meaningful only when verifying checksums
Try '../gnu/src/md5sum --help' for more information.
[$? = 1]
$ cargo run -q md5sum --strict < /dev/null
d41d8cd98f00b204e9800998ecf8427e  -
$ # No error!

Found while reviewing #6431, but also present on current main (2769a5c).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions