Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/uu/cksum/src/cksum.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)?;
Expand Down
1 change: 0 additions & 1 deletion src/uu/hashsum/locales/en-US.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion src/uu/hashsum/locales/fr-FR.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
22 changes: 2 additions & 20 deletions src/uu/hashsum/src/hashsum.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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)?;
Expand All @@ -229,7 +225,6 @@ pub fn uumain(mut args: impl uucore::Args) -> UResult<()> {
/* base64: */ false,
),
line_ending,
no_names,
};

let files = matches.get_many::<OsString>(options::FILE).map_or_else(
Expand Down Expand Up @@ -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())
}
Expand All @@ -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")),
Expand Down
9 changes: 0 additions & 9 deletions src/uucore/src/lib/features/checksum/compute.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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 {
Expand Down
15 changes: 1 addition & 14 deletions tests/by-util/test_hashsum.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::<Vec<&str>>()[0]
Expand Down Expand Up @@ -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!());
Expand Down
Loading