mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 19:47:45 +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:
parent
ef0377d3da
commit
ab6d95cdb9
4 changed files with 70 additions and 19 deletions
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue