mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 11:37:44 +00:00
hashsum: allow multiple usage of -l and take the last one
tested by gnu/tests/cksum/b2sum.sh
This commit is contained in:
parent
b64183b0de
commit
dc5342d115
2 changed files with 18 additions and 1 deletions
|
@ -481,7 +481,8 @@ fn uu_app_opt_length(command: Command) -> Command {
|
|||
.long("length")
|
||||
.help("digest length in bits; must not exceed the max for the blake2 algorithm (512) and must be a multiple of 8")
|
||||
.value_name("BITS")
|
||||
.value_parser(parse_bit_num),
|
||||
.value_parser(parse_bit_num)
|
||||
.overrides_with("length"),
|
||||
)
|
||||
}
|
||||
|
||||
|
|
|
@ -180,6 +180,22 @@ fn test_check_b2sum_length_option_0() {
|
|||
.stdout_only("testf: OK\n");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_check_b2sum_length_duplicate() {
|
||||
let scene = TestScenario::new(util_name!());
|
||||
let at = &scene.fixtures;
|
||||
|
||||
at.write("testf", "foobar\n");
|
||||
|
||||
scene
|
||||
.ccmd("b2sum")
|
||||
.arg("--length=123")
|
||||
.arg("--length=128")
|
||||
.arg("testf")
|
||||
.succeeds()
|
||||
.stdout_contains("d6d45901dec53e65d2b55fb6e2ab67b0");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_check_b2sum_length_option_8() {
|
||||
let scene = TestScenario::new(util_name!());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue