Convert --help and --version to man page.
GPL-3.0 License
Convert --help
and --version
to man page.
--help
and --version
. Written in perl.--help
and --version
. Written in python.--help
and --version
or any argparse-based pythonThis a python version of GNU help2man. It solves the following problems[^email]:
GNU help2man
cannot convert argparse
correctlyBecause argparse outputs:
usage: help2man [-h] ...
executable ...
Convert --help and --version to man page.
positional arguments:
executable executable program name
...
options:
-h show this help message and exit
...
help2man
will ignore positional arguments:
and options:
because it only
detect Options:
. And it only detect first line as synopsis and detect other
lines as description incorrectly.
GNU help2man
cannot customize templateI provide help2man --template XXX
and help2man --template-file XXX
to do
it. The template language is
jinja2. See
template
as examples.
Now you can use it in python. If you want to generate man pages automatically when you build a python project, you can see setuptools-generate:
See document to know more.
[^email]: I send email to the author of GNU help2man
but got no response.