Skip to main content

Convert --help and --version to man page.

Project description

help2man

pre-commit.ci status github/workflow codecov readthedocs

github/downloads github/downloads/latest github/issues github/issues-closed github/issues-pr github/issues-pr-closed github/discussions github/milestones github/forks github/stars github/watchers github/contributors github/commit-activity github/last-commit github/release-date

github/license github/languages github/languages/top github/directory-file-count github/code-size github/repo-size github/v

pypi/status pypi/v pypi/downloads pypi/format pypi/implementation pypi/pyversions

Convert --help and --version to man page.

Similar Projects

  • GNU help2man Generate manpage for any program with --help and --version. Written in perl.
  • click-man Generate manpage for click-based python program. Written in python.
  • cli2man Generate manpage and markdown for any program with --help and --version. Written in python.
  • This project: Generate manpage, markdown or any format (if you provide a jinja template) for any program with --help and --version or any argparse-based python program.

Intention

This a python version of GNU help2man. It solves the following problems[^email]:

GNU help2man cannot convert argparse correctly

Because 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 template

I provide help2man --template XXX and help2man --template-file XXX to do it. The template language is jinja2. See template as examples.

GNU help2man don't provide any programming API

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

help2man-0.0.9.tar.gz (36.0 kB view hashes)

Uploaded Source

Built Distribution

help2man-0.0.9-py3-none-any.whl (28.7 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page