GNU bug report logs - #44960
date --expose-flags

Previous Next

Package: coreutils;

Reported by: 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>

Date: Mon, 30 Nov 2020 13:23:02 UTC

Severity: normal

Done: Paul Eggert <eggert <at> cs.ucla.edu>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 44960 in the body.
You can then email your comments to 44960 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-coreutils <at> gnu.org:
bug#44960; Package coreutils. (Mon, 30 Nov 2020 13:23:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>:
New bug report received and forwarded. Copy sent to bug-coreutils <at> gnu.org. (Mon, 30 Nov 2020 13:23:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>
To: bug-coreutils <at> gnu.org
Subject: date --expose-flags
Date: Mon, 30 Nov 2020 21:21:45 +0800
I got this brilliant idea.
Let's say one likes the output of

$ date --iso-8601=seconds
2020-11-30T21:15:47+08:00

but wants to know "how you did it?"

Hmmm, no assistance from
$ date --iso-8601=seconds --debug
2020-11-30T21:15:50+08:00

Ah, if only there were a:
$ date --iso-8601=seconds --expose-flags
date +%Y-%m-%dT%H:%M:%S%z

Then one needn't use trial and error to figure out the template being
used behind the scenes!

date (GNU coreutils) 8.32




Information forwarded to bug-coreutils <at> gnu.org:
bug#44960; Package coreutils. (Mon, 30 Nov 2020 13:25:02 GMT) Full text and rfc822 format available.

Message #8 received at submit <at> debbugs.gnu.org (full text, mbox):

From: 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>
To: bug-coreutils <at> gnu.org
Subject: Re: date --expose-flags
Date: Mon, 30 Nov 2020 21:24:28 +0800
date +%Y-%m-%dT%H:%M:%S%z
                        ^I meant %:z

> Then one needn't use trial and error

(Driving my point home.)




Information forwarded to bug-coreutils <at> gnu.org:
bug#44960; Package coreutils. (Mon, 30 Nov 2020 19:12:01 GMT) Full text and rfc822 format available.

Message #11 received at 44960 <at> debbugs.gnu.org (full text, mbox):

From: Pádraig Brady <P <at> draigBrady.com>
To: 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>,
 44960 <at> debbugs.gnu.org
Subject: Re: bug#44960: date --expose-flags
Date: Mon, 30 Nov 2020 19:10:57 +0000
On 30/11/2020 13:21, 積丹尼 Dan Jacobson wrote:
> I got this brilliant idea.
> Let's say one likes the output of
> 
> $ date --iso-8601=seconds
> 2020-11-30T21:15:47+08:00
> 
> but wants to know "how you did it?"
> 
> Hmmm, no assistance from
> $ date --iso-8601=seconds --debug
> 2020-11-30T21:15:50+08:00
> 
> Ah, if only there were a:
> $ date --iso-8601=seconds --expose-flags
> date +%Y-%m-%dT%H:%M:%S%z
> 
> Then one needn't use trial and error to figure out the template being
> used behind the scenes!

A useful idea.
I'll add that with the following.

thanks,
Pádraig

commit 17af226bd80db3376e9137384c1ba14a8d94c434 (HEAD -> master)
Author: Pádraig Brady <P <at> draigBrady.com>
Date:   Mon Nov 30 19:06:59 2020 +0000

    date: with --debug, output the format used

    * src/date.c (main): The format can be determined from
    --options or the locale, so it's useful to output
    the format string being used.
    Addresses https://bugs.gnu.org/44960

diff --git a/src/date.c b/src/date.c
index c33fa3fc5..20af782df 100644
--- a/src/date.c
+++ b/src/date.c
@@ -505,6 +505,9 @@ main (int argc, char **argv)
         }
     }

+  if (parse_datetime_flags & PARSE_DATETIME_DEBUG)
+    error (0, 0, _("using date format %s"), quote (format));
+
   char const *tzstring = getenv ("TZ");
   timezone_t tz = tzalloc (tzstring);




bug closed, send any further explanations to 44960 <at> debbugs.gnu.org and 積丹尼 Dan Jacobson <jidanni <at> jidanni.org> Request was from Paul Eggert <eggert <at> cs.ucla.edu> to control <at> debbugs.gnu.org. (Thu, 24 Feb 2022 02:43:01 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 24 Mar 2022 11:24:10 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 31 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.