From c6389a1340cdc2a74dbbba5db13df009ada3c04c Mon Sep 17 00:00:00 2001 From: Assaf Gordon Date: Thu, 8 Sep 2016 01:00:23 -0400 Subject: date: add '--debug' option Usage example: date --debug -d 'now + 3 days' Print parsing and debugging information to stderr when using date's -d/--date option. See: http://lists.gnu.org/archive/html/coreutils/2016-01/msg00076.html * src/date.c (main): Add '--debug' option, enable debugging in gnulib's parse-datetime.y module. * tests/misc/date.pl: Repeat tests with '--debug' enable, ensure no regression. * tests/misc/date-debug.sh: Test output of '--debug' option. * tests/local.mk: Add above test. * NEWS: Mention new option. * doc/coreutils.texi: Likewise. --- doc/coreutils.texi | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'doc') diff --git a/doc/coreutils.texi b/doc/coreutils.texi index cc5e53cf5..95419b44e 100644 --- a/doc/coreutils.texi +++ b/doc/coreutils.texi @@ -521,8 +521,8 @@ Include the version number, machine architecture, input files, and any other information needed to reproduce the bug: your input, what you expected, what you got, and why it is wrong. -If you have a problem with @command{sort}, try running @samp{sort ---debug}, as it can can often help find and fix problems without +If you have a problem with @command{sort} or @command{date}, try using the +@option{--debug} option, as it can can often help find and fix problems without having to wait for an answer to a bug report. If the debug output does not suffice to fix the problem on your own, please compress and attach it to the rest of your bug report. @@ -15392,6 +15392,14 @@ date -d "$(LC_TIME=C date)" @end example @xref{Date input formats}. +@item --debug +@opindex --debug +@cindex debugging date strings +@cindex date strings, debugging +@cindex arbitrary date strings, debugging +annotate the parsed date, display the effective time zone, and warn about +potential misuse. + @item -f @var{datefile} @itemx --file=@var{datefile} @opindex -f -- cgit v1.2.3-70-g09d2