It has long been a pet peeve of mine that the *nix world has no standard reliable convention for how to interrogate a program for it's available flags. Instead there are at least a dozen ways it can be done and you can't rely on any one of them.
I've been thinking about using an OpenAPI schema to describe cli tools. It would probably need extensions to describe stdin/stout and other things that don't happen in REST.
That's not specific to unix though.