dateutils icon indicating copy to clipboard operation
dateutils copied to clipboard

Improve ddiff error behaviour

Open rdiez opened this issue 1 year ago • 2 comments

Say I supply a date to ddiff which fails to parse.

$ dateutils.ddiff "2024-10-dd" today
ddiff: Error: reference DATE must be specified

Usage: datediff [OPTION]... DATE/TIME [DATE/TIME]...

Compute duration from DATE/TIME (the reference date/time) to the other
<...>

First of all, error message "reference DATE must be specified" is misleading, as I did supply a date. If ddiff cannot parse it, it should say "error parsing", "invalid date" or similar.

The other issue is that, after the error, you get the whole help text starting with "Usage:". I have to scroll up a lot to find the error message at the top. Is there a way to suppress the help text?

rdiez avatar Oct 22 '24 19:10 rdiez

Hey, thanks for the report. A fix is in bf462b5e9.

hroptatyr avatar Oct 24 '24 09:10 hroptatyr

Great, thanks for the quick reaction!

rdiez avatar Oct 24 '24 16:10 rdiez