https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89961

--- Comment #23 from xaizek <xaizek at posteo dot net> ---
> it should be fixed in the updated version of the patch.

Yes, it is.

> Right now, one can easily detect JSON format with
> `gcov --help | grep json-format`, am I right? What type of capability would
> you appreciate?

Correct, but `--help` and `--version` are formatted for humans, not machines.
This can lead to false positives or negatives.  It forces every application
that
calls gcov and wants to support wide range of versions to embed its copy of
knowledge about gcov's development history.  And `--help` won't tell if `-x`
works with `--json-format`, that's why `--version` needs to be used as well.

For consistency, since there is output for machines, it would be nice to have a
way to know how to get it and what to expect from it for machines as well.

I'd include any addition/removal/change between versions that makes difference,
like "has-json-format-option", "can-hash-json-files", "has-stdout-option".
Basically a hard-coded list that's easy to check.

This isn't so much for existing releases (unless it's backported), but in
anticipation of future changes that can affect the caller.  I don't have an
example of such interface in apps, just wanted to bring it up for your
consideration.

Reply via email to