From e635c78ceae93f9919648454d05c0a3b0e9de97c Mon Sep 17 00:00:00 2001 From: oech3 <> Date: Wed, 7 Jan 2026 07:47:38 +0900 Subject: [PATCH] hashsum: support --text --tag for GNU compat --- src/uu/hashsum/src/hashsum.rs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/uu/hashsum/src/hashsum.rs b/src/uu/hashsum/src/hashsum.rs index 3bc6dcff5b2..813ae20191b 100644 --- a/src/uu/hashsum/src/hashsum.rs +++ b/src/uu/hashsum/src/hashsum.rs @@ -216,7 +216,7 @@ pub fn uumain(mut args: impl uucore::Args) -> UResult<()> { mod options { //pub const ALGORITHM: &str = "algorithm"; pub const FILE: &str = "file"; - //pub const UNTAGGED: &str = "untagged"; + pub const UNTAGGED: &str = "untagged"; //We have this only for supporting --text --tag pub const TAG: &str = "tag"; pub const LENGTH: &str = "length"; //pub const RAW: &str = "raw"; @@ -238,6 +238,12 @@ pub fn uu_app_common() -> Command { .override_usage(format_usage(&translate!("hashsum-usage"))) .infer_long_args(true) .args_override_self(true) + .arg( + Arg::new(options::UNTAGGED) + .long(options::UNTAGGED) + .hide(true) + .action(ArgAction::SetTrue), + ) .arg( Arg::new(options::BINARY) .short('b') @@ -267,7 +273,7 @@ pub fn uu_app_common() -> Command { .long("tag") .help(translate!("hashsum-help-tag")) .action(ArgAction::SetTrue) - .conflicts_with("text"), + .overrides_with(options::TEXT), ) .arg( Arg::new(options::TEXT) @@ -284,6 +290,7 @@ pub fn uu_app_common() -> Command { } }) .conflicts_with("binary") + .requires(options::UNTAGGED) .action(ArgAction::SetTrue), ) .arg(