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

2016-08-20 Thread Jim Meyering
On Fri, Aug 19, 2016 at 1:48 PM, Pádraig Brady wrote: > On 15/08/16 02:36, Assaf Gordon wrote: >> >>> On Aug 12, 2016, at 04:37, Pádraig Brady wrote: >>> >>> There's precedent for .2() versions of functions, like renameat2() etc. >>> How about we pass an unsigned int flags, instead of bool, i

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

2016-08-20 Thread Assaf Gordon
> On Aug 19, 2016, at 16:48, Pádraig Brady wrote: > > Looks good and pushed. Thanks! I'll send the coreutils' corresponding patch next. regards, - assaf

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

2016-08-19 Thread Pádraig Brady
On 15/08/16 02:36, Assaf Gordon wrote: > >> On Aug 12, 2016, at 04:37, Pádraig Brady wrote: >> >> There's precedent for .2() versions of functions, like renameat2() etc. >> How about we pass an unsigned int flags, instead of bool, in case we ever >> need to extend in future? > > Attached a v

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

2016-08-14 Thread Assaf Gordon
> On Aug 12, 2016, at 04:37, Pádraig Brady wrote: > > There's precedent for .2() versions of functions, like renameat2() etc. > How about we pass an unsigned int flags, instead of bool, in case we ever > need to extend in future? Attached a version with 'unsigned in flags' instead of 'bool

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

2016-08-12 Thread Pádraig Brady
On 12/08/16 04:38, Assaf Gordon wrote: >> On Aug 10, 2016, at 05:59, Pádraig Brady wrote: >> >> Those look good to squash and apply, >> modulo s/setftime/strftime/ in modules/parse-datetime > > Thank you for the review. > Attached a squashed patch. > I kept the name of the new function as 'parse_

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

2016-08-11 Thread Assaf Gordon
> On Aug 10, 2016, at 05:59, Pádraig Brady wrote: > > Those look good to squash and apply, > modulo s/setftime/strftime/ in modules/parse-datetime Thank you for the review. Attached a squashed patch. I kept the name of the new function as 'parse_datetime2' (if that's acceptable). Comments welco

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

2016-08-10 Thread Pádraig Brady
On 10/08/16 05:07, Assaf Gordon wrote: > Hello Paul, Pádraig, > > Thank you for the review and suggestions. > Attached is a suggested draft patch to address some of the issues: > >> On Aug 9, 2016, at 12:32, Paul Eggert wrote: >> >> These days, there's little reason to use macros instead of stat

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

2016-08-09 Thread Assaf Gordon
Hello Paul, Pádraig, Thank you for the review and suggestions. Attached is a suggested draft patch to address some of the issues: > On Aug 9, 2016, at 12:32, Paul Eggert wrote: > > These days, there's little reason to use macros instead of static functions. > So I suggest renaming DEBUG0 to de

Re: Fwd: suggested feature: "date --debug" - print date parsing diagnostics

2016-08-09 Thread Paul Eggert
Thanks for taking this on. Some comments. These days, there's little reason to use macros instead of static functions. So I suggest renaming DEBUG0 to debug0 and making it a static function, and similarly for the other macros. Also, the debug function should call gettext, instead of having it

Fwd: suggested feature: "date --debug" - print date parsing diagnostics

2016-08-09 Thread Pádraig Brady
FYI attached is a proposed patch from Assaf Gordon. I'm about to apply this to the parse-datetime module to support diagnostic output to help users. This will be enabled soon from the coreutils date(1) util like: $ TZ=America/Belize src/date --debug \ -d 'TZ="Asia/Tokyo" Su