help2man
generates man pages from program --help and --version output
TLDR
SYNOPSIS
help2man [options] executable
DESCRIPTION
help2man generates man pages from a program's `--help` and `--version` output. It parses the structured help text and formats it as troff-style man page source, creating basic documentation automatically.The tool produces minimal man pages suitable for programs that follow GNU conventions for help output. Additional content can be added via include files (`.h2m`), which support inserting text before or after automatically generated sections using `[section]` headers.
PARAMETERS
EXECUTABLE
Program whose --help and --version output will be used to generate the man page.-n, --name STRING
Short description for the NAME section.-s, --section NUM
Man page section number (default: 1).-i, --include FILE
Include extra material from file. The file uses `[section]` headers to place text.-I, --opt-include FILE
Like -i but does not fail if file is missing.-N, --no-info
Suppress the "see also info page" pointer.-o, --output FILE
Write output to file instead of stdout.-m, --manual TEXT
Name of the manual (e.g., "User Commands").-S, --source TEXT
Source of the program (e.g., "FSF", "Debian").-L, --locale STRING
Set locale for fetching help output (default: "C").-l, --libtool
Drop libtool `lt-` prefix from program name.-p, --info-page TEXT
Name of Texinfo manual to reference.-h, --help-option STRING
Alternative help option string to use instead of --help.-v, --version-option STRING
Alternative version option string to use instead of --version.--version-string STRING
Use this version string instead of running the program's version option.--no-discard-stderr
Include stderr output when parsing option output.--version
Show help2man version.
CAVEATS
Output quality depends heavily on the format of the program's `--help` output. Works best with GNU-style option formatting (leading dashes, aligned descriptions). Programs with non-standard help text may produce poorly formatted man pages that require manual editing. Does not document features not mentioned in `--help` output.
HISTORY
help2man was created by Brendan O'Dea as part of the GNU project to automate man page generation for GNU utilities during the build process.
