coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: suggested feautre: "date --debug" - print date parsing diagnostics


From: Pádraig Brady
Subject: Re: suggested feautre: "date --debug" - print date parsing diagnostics
Date: Sun, 24 Jan 2016 05:05:45 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0

On 23/01/16 03:03, Assaf Gordon wrote:
> From e3623e537c3b198c5ec126dc4d556ffd0f00ea92 Mon Sep 17 00:00:00 2001
> From: Assaf Gordon <address@hidden>
> Date: Wed, 20 Jan 2016 19:43:29 -0500
> Subject: [PATCH] date: add '--debug' option
> 
> * 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.

* NEWS: Needs an entry.
* doc/coreutils.texi: Likewise.

It would be good to compare expected debug output in the tests,
but you're right to wait until the output format is locked down fully.

> diff --git a/src/date.c b/src/date.c

> @@ -133,6 +135,8 @@ Display the current time in the given FORMAT, or set the 
> system date.\n\
>  
>        fputs (_("\
>    -d, --date=STRING          display time described by STRING, not 'now'\n\
> +      --debug                annotate the parsed date,\n\
> +                              and warn about questionable usage to stderr\n\
>    -f, --file=DATEFILE        like --date; once for each line of DATEFILE\n\
>  "), stdout);
>        fputs (_("\

It's better to fputs() just the --debug help separate
from existing --help output, to simplify translators jobs.

gnulib review in a separate reply to the updated gnulib portion.

thanks,
Pádraig




reply via email to

[Prev in Thread] Current Thread [Next in Thread]