matteocorti/check_ssl_cert

Output format on failure?

Opened this issue · 6 comments

mmdevl commented

It's possible to set an output format on success:

check_ssl_cert --help | grep FORMAT
      --format FORMAT              Format output template on success, for

What about setting also an output format on failure?

Not really a bug but a missing feature. On failure, not all the data is available, and the formatting could be complicated. I'll have a look.

mmdevl commented

You're right (missing feature). You could add these 2 new options:

      --default-failure-format [*]
      --format-failure FORMAT

[*] you already have a kind of default

I would rather try to keep one option and just display what is available.

I'm still struggling with the failure format, as the content could be very different depending on the error. From one single sentence as for a wrong command line option, to the full output in case of an expired certificate.

I did some refactoring, putting the parsing in a separate function, but I'll leave it here for the moment as I don't really have a bright idea on how to implement it.

The separate command line option would bear the same problems.

Hi Matteo, is there a solution/fix for this issue?

Not yet, if I find the time I'll try to implement a solution