Skip to content

Commit 4312f3c

Browse files
committed
cksum: adding -b as the short form for --base64
closes #5706
1 parent 874c4f2 commit 4312f3c

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

src/uu/cksum/src/cksum.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -448,6 +448,7 @@ pub fn uu_app() -> Command {
448448
.arg(
449449
Arg::new(options::BASE64)
450450
.long(options::BASE64)
451+
.short('b')
451452
.help("emit a base64 digest, not hexadecimal")
452453
.action(ArgAction::SetTrue)
453454
// Even though this could easily just override an earlier '--raw',

tests/by-util/test_cksum.rs

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -379,13 +379,15 @@ fn test_base64_raw_conflicts() {
379379
#[test]
380380
fn test_base64_single_file() {
381381
for algo in ALGOS {
382-
new_ucmd!()
383-
.arg("--base64")
384-
.arg("lorem_ipsum.txt")
385-
.arg(format!("--algorithm={algo}"))
386-
.succeeds()
387-
.no_stderr()
388-
.stdout_is_fixture_bytes(format!("base64/{algo}_single_file.expected"));
382+
for base64_option in ["--base64", "-b"] {
383+
new_ucmd!()
384+
.arg(base64_option)
385+
.arg("lorem_ipsum.txt")
386+
.arg(format!("--algorithm={algo}"))
387+
.succeeds()
388+
.no_stderr()
389+
.stdout_is_fixture_bytes(format!("base64/{algo}_single_file.expected"));
390+
}
389391
}
390392
}
391393
#[test]

0 commit comments

Comments
 (0)