diff --git a/src/uu/cksum/src/cksum.rs b/src/uu/cksum/src/cksum.rs index eb08f008b65..666a0e982a5 100644 --- a/src/uu/cksum/src/cksum.rs +++ b/src/uu/cksum/src/cksum.rs @@ -216,7 +216,6 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> { algo_kind: algo, output_format, line_ending, - no_names: false, }; perform_checksum_computation(opts, files)?; diff --git a/src/uu/hashsum/locales/en-US.ftl b/src/uu/hashsum/locales/en-US.ftl index 2001a849181..1c9e40f66e0 100644 --- a/src/uu/hashsum/locales/en-US.ftl +++ b/src/uu/hashsum/locales/en-US.ftl @@ -18,7 +18,6 @@ hashsum-help-ignore-missing = don't fail or report status for missing files hashsum-help-warn = warn about improperly formatted checksum lines hashsum-help-zero = end each output line with NUL, not newline hashsum-help-length = digest length in bits; must not exceed the max for the blake2 algorithm and must be a multiple of 8 -hashsum-help-no-names = Omits filenames in the output (option not present in GNU/Coreutils) hashsum-help-bits = set the size of the output (only for SHAKE) # Algorithm help messages diff --git a/src/uu/hashsum/locales/fr-FR.ftl b/src/uu/hashsum/locales/fr-FR.ftl index e612841a56b..87065c6143a 100644 --- a/src/uu/hashsum/locales/fr-FR.ftl +++ b/src/uu/hashsum/locales/fr-FR.ftl @@ -15,7 +15,6 @@ hashsum-help-ignore-missing = ne pas échouer ou rapporter le statut pour les fi hashsum-help-warn = avertir des lignes de somme de contrôle mal formatées hashsum-help-zero = terminer chaque ligne de sortie avec NUL, pas de retour à la ligne hashsum-help-length = longueur de l'empreinte en bits ; ne doit pas dépasser le maximum pour l'algorithme blake2 et doit être un multiple de 8 -hashsum-help-no-names = Omet les noms de fichiers dans la sortie (option non présente dans GNU/Coreutils) hashsum-help-bits = définir la taille de la sortie (uniquement pour SHAKE) # Messages d'aide des algorithmes diff --git a/src/uu/hashsum/src/hashsum.rs b/src/uu/hashsum/src/hashsum.rs index 31ab09a0ac1..a096238f9dc 100644 --- a/src/uu/hashsum/src/hashsum.rs +++ b/src/uu/hashsum/src/hashsum.rs @@ -3,7 +3,7 @@ // For the full copyright and license information, please view the LICENSE // file that was distributed with this source code. -// spell-checker:ignore (ToDO) algo, algoname, bitlen, regexes, nread, nonames +// spell-checker:ignore (ToDO) algo, algoname, bitlen, regexes, nread use std::ffi::{OsStr, OsString}; use std::iter; @@ -211,10 +211,6 @@ pub fn uumain(mut args: impl uucore::Args) -> UResult<()> { return Err(ChecksumError::StrictNotCheck.into()); } - let no_names = *matches - .try_get_one("no-names") - .unwrap_or(None) - .unwrap_or(&false); let line_ending = LineEnding::from_zero_flag(matches.get_flag("zero")); let algo = SizedAlgoKind::from_unsized(algo_kind, length)?; @@ -229,7 +225,6 @@ pub fn uumain(mut args: impl uucore::Args) -> UResult<()> { /* base64: */ false, ), line_ending, - no_names, }; let files = matches.get_many::(options::FILE).map_or_else( @@ -384,19 +379,6 @@ fn uu_app_opt_length(command: Command) -> Command { ) } -pub fn uu_app_b3sum() -> Command { - uu_app_b3sum_opts(uu_app_common()) -} - -fn uu_app_b3sum_opts(command: Command) -> Command { - command.arg( - Arg::new("no-names") - .long("no-names") - .help(translate!("hashsum-help-no-names")) - .action(ArgAction::SetTrue), - ) -} - pub fn uu_app_bits() -> Command { uu_app_opt_bits(uu_app_common()) } @@ -414,7 +396,7 @@ fn uu_app_opt_bits(command: Command) -> Command { } pub fn uu_app_custom() -> Command { - let mut command = uu_app_b3sum_opts(uu_app_opt_bits(uu_app_common())); + let mut command = uu_app_opt_bits(uu_app_common()); let algorithms = &[ ("md5", translate!("hashsum-help-md5")), ("sha1", translate!("hashsum-help-sha1")), diff --git a/src/uucore/src/lib/features/checksum/compute.rs b/src/uucore/src/lib/features/checksum/compute.rs index 5bf5591358b..c08765af40e 100644 --- a/src/uucore/src/lib/features/checksum/compute.rs +++ b/src/uucore/src/lib/features/checksum/compute.rs @@ -34,9 +34,6 @@ pub struct ChecksumComputeOptions { /// Whether to finish lines with '\n' or '\0'. pub line_ending: LineEnding, - - /// (non-GNU option) Do not print file names - pub no_names: bool, } /// Reading mode used to compute digest. @@ -218,12 +215,6 @@ fn print_untagged_checksum( sum: &String, reading_mode: ReadingMode, ) -> UResult<()> { - // early check for the "no-names" option - if options.no_names { - print!("{sum}"); - return Ok(()); - } - let (escaped_filename, prefix) = if options.line_ending == LineEnding::Nul { (filename.to_string_lossy().to_string(), "") } else { diff --git a/tests/by-util/test_hashsum.rs b/tests/by-util/test_hashsum.rs index 10ab26e371d..e39fe429efb 100644 --- a/tests/by-util/test_hashsum.rs +++ b/tests/by-util/test_hashsum.rs @@ -8,7 +8,7 @@ use rstest::rstest; use uutests::new_ucmd; use uutests::util::TestScenario; use uutests::util_name; -// spell-checker:ignore checkfile, nonames, testf, ntestf +// spell-checker:ignore checkfile, testf, ntestf macro_rules! get_hash( ($str:expr) => ( $str.split(' ').collect::>()[0] @@ -41,19 +41,6 @@ macro_rules! test_digest { get_hash!(ts.ucmd().arg(DIGEST_ARG).arg(BITS_ARG).pipe_in_fixture(INPUT_FILE).succeeds().no_stderr().stdout_str())); } - #[test] - fn test_nonames() { - let ts = TestScenario::new(util_name!()); - // EXPECTED_FILE has no newline character at the end - if DIGEST_ARG == "--b3sum" { - // Option only available on b3sum - assert_eq!(format!("{0}\n{0}\n", ts.fixtures.read(EXPECTED_FILE)), - ts.ucmd().arg(DIGEST_ARG).arg(BITS_ARG).arg("--no-names").arg(INPUT_FILE).arg("-").pipe_in_fixture(INPUT_FILE) - .succeeds().no_stderr().stdout_str() - ); - } - } - #[test] fn test_check() { let ts = TestScenario::new(util_name!());