1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-28 11:37:44 +00:00

cksum: check ourself the flags --check and --tag and output the correct error

This commit is contained in:
tommi 2025-01-05 10:28:08 +01:00
parent 1e8e16b79c
commit dd17f9a61c

View file

@ -301,8 +301,9 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
let warn = matches.get_flag(options::WARN);
let ignore_missing = matches.get_flag(options::IGNORE_MISSING);
let quiet = matches.get_flag(options::QUIET);
let tag = matches.get_flag(options::TAG);
if binary_flag || text_flag {
if tag || binary_flag || text_flag {
return Err(ChecksumError::BinaryTextConflict.into());
}
// Determine the appropriate algorithm option to pass
@ -426,8 +427,7 @@ pub fn uu_app() -> Command {
.short('c')
.long(options::CHECK)
.help("read hashsums from the FILEs and check them")
.action(ArgAction::SetTrue)
.conflicts_with("tag"),
.action(ArgAction::SetTrue),
)
.arg(
Arg::new(options::BASE64)