Benoît Knecht wrote:
> The help output and man page mention that "by default, date pads numeric
> fields with zeroes," yet the description of %k and %l didn't specify
> that these values were space padded, whereas the description of %e did.
>
> Fixes <http://bugs.debian.org/115833>.
> ---
>
> Hi,
>
> If anyone is still interested in fixing this bug, here's a trivial patch
> that amends the documentation of date accordingly. Otherwise, feel free
> to close this bug as won't fix.

Thanks for the patch.
I've turned that into something I can use upstream.
If you send more patches, please follow this model (note the form of
the commit log and credit the reporter in the log and add mention in
THANKS.in; details in HACKING).

>From 4d6f5ba0477c086fb3258d8bfc638393a16087ed Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Beno=C3=AEt=20Knecht?= <benoit.kne...@fsfe.org>
Date: Thu, 7 Jul 2011 10:55:47 +0200
Subject: [PATCH] date: note %k and %l are space-padded and equivalent to %_H
 and %_I

* src/date.c (usage): As above, for --help.
* doc/coreutils.texi (Time conversion specifiers): Likewise.
Reported by Britton Leo Kerin in http://bugs.debian.org/115833.
---
 THANKS.in          |    1 +
 doc/coreutils.texi |    4 ++--
 src/date.c         |    4 ++--
 3 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/THANKS.in b/THANKS.in
index 2979d52..87c5b19 100644
--- a/THANKS.in
+++ b/THANKS.in
@@ -92,6 +92,7 @@ Brian Kimball                       b...@footbag.org
 Brian M. Carlson                    sand...@crustytoothpaste.ath.cx
 Brian Silverman                     bsilver...@conceptxdesign.com
 Brian Youmans                       3d...@gnu.org
+Britton Leo Kerin                   fs...@aurora.uaf.edu
 Bruce Robertson                     bru...@theodolite.dyndns.org
 Carl Johnson                        ca...@cjlinux.home.org
 Carl Lowenstein                     c...@mpl.ucsd.edu
diff --git a/doc/coreutils.texi b/doc/coreutils.texi
index c59af2f..11ac7fd 100644
--- a/doc/coreutils.texi
+++ b/doc/coreutils.texi
@@ -13921,10 +13921,10 @@ Time conversion specifiers
 @item %I
 hour (@samp{01}@dots{}@samp{12})
 @item %k
-hour (@samp{ 0}@dots{}@samp{23}).
+hour, space padded (@samp{ 0}@dots{}@samp{23}); equivalent to @samp{%_H}.
 This is a @acronym{GNU} extension.
 @item %l
-hour (@samp{ 1}@dots{}@samp{12}).
+hour, space padded (@samp{ 1}@dots{}@samp{12}); equivalent to @samp{%_I}.
 This is a @acronym{GNU} extension.
 @item %M
 minute (@samp{00}@dots{}@samp{59})
diff --git a/src/date.c b/src/date.c
index 6439d16..755736a 100644
--- a/src/date.c
+++ b/src/date.c
@@ -179,8 +179,8 @@ FORMAT controls the output.  Interpreted sequences are:\n\
   %j   day of year (001..366)\n\
 "), stdout);
       fputs (_("\
-  %k   hour ( 0..23)\n\
-  %l   hour ( 1..12)\n\
+  %k   hour, space padded ( 0..23); same as %_H\n\
+  %l   hour, space padded ( 1..12); same as %_I\n\
   %m   month (01..12)\n\
   %M   minute (00..59)\n\
 "), stdout);
--
1.7.6.430.g34be2



--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to