Skip to content

Improve ddiff error behaviour #162

@rdiez

Description

@rdiez

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions