1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-28 03:27:44 +00:00

ls: display %Z alphabetic time zone abbreviation

Display the alphabetic timezone abbreviation (like "UTC" or "CET") when
the `--time-style` argument includes a `%Z` directive. This matches the
behavior of `date`.

Fixes #7035
This commit is contained in:
Jeffrey Finkelstein 2025-01-18 09:33:52 -05:00
parent ef0377d3da
commit ab6d95cdb9
4 changed files with 70 additions and 19 deletions

View file

@ -5628,3 +5628,14 @@ fn test_non_unicode_names() {
.succeeds()
.stdout_is_bytes(b"\xC0.dir\n\xC0.file\n");
}
#[test]
fn test_time_style_timezone_name() {
let re_custom_format = Regex::new(r"[a-z-]* \d* [\w.]* [\w.]* \d* UTC f\n").unwrap();
let (at, mut ucmd) = at_and_ucmd!();
at.touch("f");
ucmd.env("TZ", "UTC0")
.args(&["-l", "--time-style=+%Z"])
.succeeds()
.stdout_matches(&re_custom_format);
}