logo

utils-extra

Collection of extra tools for Unixes
commit: 874e882dff6bd580bd17427dc41d55e329665da3
parent c3e46cca9d8808e96ccffb5e97d596203294f753
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date:   Mon,  8 Apr 2024 18:36:34 +0200

cmd/humanize: Replace 年月日 with YMD respectively

Diffstat:

Mcmd/humanize.c6+++---
Mtest-cmd/humanize8++++----
2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/cmd/humanize.c b/cmd/humanize.c @@ -49,9 +49,9 @@ human_time(long int epoch) epoch %= 60; sec = epoch; - if(year > 0) printf("%d年 ", year); - if(month > 0) printf("%d月 ", month); - if(mday > 0) printf("%d日 ", mday); + if(year > 0) printf("%dY ", year); + if(month > 0) printf("%dM ", month); + if(mday > 0) printf("%dD ", mday); if(hour > 0) printf("%dh ", hour); if(min > 0) printf("%dm ", min); if(sec > 0) printf("%ds", sec); diff --git a/test-cmd/humanize b/test-cmd/humanize @@ -71,10 +71,10 @@ duration_body() { atf_check -o "inline:1s\n" ../cmd/humanize -t 1 atf_check -o "inline:1m \n" ../cmd/humanize -t 60 atf_check -o "inline:1h \n" ../cmd/humanize -t 3600 - atf_check -o "inline:1日 \n" ../cmd/humanize -t 86400 - atf_check -o "inline:1月 \n" ../cmd/humanize -t 2629743 - atf_check -o "inline:1年 \n" ../cmd/humanize -t 31556926 - atf_check -o "inline:1年 1月 1日 1h 1m 1s\n" ../cmd/humanize -t 34276730 + atf_check -o "inline:1D \n" ../cmd/humanize -t 86400 + atf_check -o "inline:1M \n" ../cmd/humanize -t 2629743 + atf_check -o "inline:1Y \n" ../cmd/humanize -t 31556926 + atf_check -o "inline:1Y 1M 1D 1h 1m 1s\n" ../cmd/humanize -t 34276730 } atf_test_case limits