Hi,
I wanted to present you the tool I made recently that generates man
pages for Go programs that use the stdlib's "flag" package:
https://github.com/n-peugnet/gohelp2man
It is mostly a copy of GNU help2man [1], but specifically made to parse
the -help output of the "flag" package. Indeed, GNU help2man is really
focused on parsing the --help output of GNU commands, and it does not
works well in this case.
It supports most of its features, so it will look familiar if you
already used help2man.
I decided to rewrite it to have full control on the output. And by
rewriting it in Go, it is well integrated in the ecosystem, thus can be
easily used by Go developers, for example with the new "go get -tool"
feature.
It was mostly made for Debian packaging as man pages are expected to be
present, so I intend to make a Debian package soon, but in the meantime
it can easily be installed with the following command (provided that you
have Go installed):
go install github.com/n-peugnet/gohelp2man@latest
[1] https://www.gnu.org/software/help2man/
P.S. I will need a sponsor for the future Debian package :)
--
Nicolas Peugnet