Skip to main content

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 problems1:

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.

  1. I send email to the author of GNU help2man but got no response. ↩

Metadata

Release files for help2man 0.0.9

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for help2man 0.0.9
File Size Uploaded
help2man-0.0.9.tar.gz 36.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for help2man 0.0.9
File Interpreter ABI Platform
help2man-0.0.9-py3-none-any.whl Python 3 none any Details

Total release size: 64.7 kB

Release files / help2man-0.0.9.tar.gz

Download URL help2man-0.0.9.tar.gz
Size 36.0 kB
Tags Source
SHA-256 checksum
How to use checksums
57fa18ed59ee94952a2341153eae34fc90020cb4ebb26ce8a7324334119cf81a
BLAKE2b-256 checksum
How to use checksums
f44183be1788195c2aa555060ea3a06c91e6ed411452beee3fd9e20e07a2e96e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.11.3

Release files / help2man-0.0.9-py3-none-any.whl

Download URL help2man-0.0.9-py3-none-any.whl
Size 28.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
36f6ec6c8a0130f85c36bd1e5dd2af34f8e60a46e5d4a271f769c9aaab6c6a1d
BLAKE2b-256 checksum
How to use checksums
4dd58c6fe57086a8cae02067391b51bfd8329a65446cfc5324da8f22d1d90bf1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.11.3

Release history Release notifications | RSS feed

This release

0.0.9 This release

2 release files

0.0.8

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page