From be520c31cd51036beadacb5d84b21bede41abc9c Mon Sep 17 00:00:00 2001 From: oech3 <> Date: Thu, 8 Jan 2026 17:39:35 +0900 Subject: [PATCH] hashsum: --text --binary is not error --- src/uu/cksum/src/cksum.rs | 1 - src/uu/hashsum/src/hashsum.rs | 2 +- tests/by-util/test_hashsum.rs | 13 +++++++++++++ 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/uu/cksum/src/cksum.rs b/src/uu/cksum/src/cksum.rs index 72c7984f049..a312bf0284e 100644 --- a/src/uu/cksum/src/cksum.rs +++ b/src/uu/cksum/src/cksum.rs @@ -262,7 +262,6 @@ pub fn uu_app() -> Command { .long(options::TEXT) .short('t') .hide(true) - .overrides_with(options::BINARY) .action(ArgAction::SetTrue) .requires(options::UNTAGGED), ) diff --git a/src/uu/hashsum/src/hashsum.rs b/src/uu/hashsum/src/hashsum.rs index a13ec468436..5b81783d9c4 100644 --- a/src/uu/hashsum/src/hashsum.rs +++ b/src/uu/hashsum/src/hashsum.rs @@ -245,6 +245,7 @@ pub fn uu_app_common() -> Command { translate!("hashsum-help-binary-other") } }) + .overrides_with(options::TEXT) .action(ArgAction::SetTrue), ) .arg( @@ -278,7 +279,6 @@ pub fn uu_app_common() -> Command { translate!("hashsum-help-text-other") } }) - .conflicts_with("binary") .action(ArgAction::SetTrue), ) .arg( diff --git a/tests/by-util/test_hashsum.rs b/tests/by-util/test_hashsum.rs index 891cb9d4dfd..8037d7c1fe5 100644 --- a/tests/by-util/test_hashsum.rs +++ b/tests/by-util/test_hashsum.rs @@ -237,6 +237,19 @@ fn test_check_sha1() { .stderr_is(""); } +#[cfg(target_os = "linux")] +#[test] +fn test_text_binary_device() { + let scene = TestScenario::new(util_name!()); + + scene + .ccmd("md5sum") + .arg("--text") + .arg("--binary") + .arg("/dev/null") + .succeeds(); +} + #[test] fn test_check_md5_ignore_missing() { let scene = TestScenario::new(util_name!());