1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-30 04:27:45 +00:00

Merge pull request #6187 from jadijadi/cksum-base64-short-option

cksum: adding -b as the short form of --base64
This commit is contained in:
Daniel Hofstetter 2024-04-04 15:36:40 +02:00 committed by GitHub
commit 082528d6de
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 10 additions and 7 deletions

View file

@ -448,6 +448,7 @@ pub fn uu_app() -> Command {
.arg( .arg(
Arg::new(options::BASE64) Arg::new(options::BASE64)
.long(options::BASE64) .long(options::BASE64)
.short('b')
.help("emit a base64 digest, not hexadecimal") .help("emit a base64 digest, not hexadecimal")
.action(ArgAction::SetTrue) .action(ArgAction::SetTrue)
// Even though this could easily just override an earlier '--raw', // Even though this could easily just override an earlier '--raw',

View file

@ -379,8 +379,9 @@ fn test_base64_raw_conflicts() {
#[test] #[test]
fn test_base64_single_file() { fn test_base64_single_file() {
for algo in ALGOS { for algo in ALGOS {
for base64_option in ["--base64", "-b"] {
new_ucmd!() new_ucmd!()
.arg("--base64") .arg(base64_option)
.arg("lorem_ipsum.txt") .arg("lorem_ipsum.txt")
.arg(format!("--algorithm={algo}")) .arg(format!("--algorithm={algo}"))
.succeeds() .succeeds()
@ -388,6 +389,7 @@ fn test_base64_single_file() {
.stdout_is_fixture_bytes(format!("base64/{algo}_single_file.expected")); .stdout_is_fixture_bytes(format!("base64/{algo}_single_file.expected"));
} }
} }
}
#[test] #[test]
fn test_base64_multiple_files() { fn test_base64_multiple_files() {
new_ucmd!() new_ucmd!()