help2man(1)

help2man1

Generate a simple manual page

Usage

help2man [OPTION] ... EXECUTABLE

Overview

`help2man' generates a man page out of `--help' and `--version' output.

-n, --name=STRING

description for the NAME paragraph

-s, --section=SECTION

section number for manual page (1, 6, 8)

-m, --manual=TEXT

name of manual (User Commands, ...)

-S, --source=TEXT

source of program (FSF, Debian, ...)

-L, --locale=STRING

select locale (default "C")

-i, --include=FILE

include material from `FILE'

-I, --opt-include=FILE

include material from `FILE' if it exists

-o, --output=FILE

send output to `FILE'

-p, --info-page=TEXT

name of Texinfo manual

-N, --no-info

suppress pointer to Texinfo manual

-l, --libtool

exclude the `lt-' from the program name

--help

print this help, then exit

--version

print version number, then exit

EXECUTABLE should accept `--help' and `--version' options and produce output on stdout although alternatives may be specified using:

-h, --help-option=STRING

help option string

-v, --version-option=STRING

version option string

--version-string=STRING

version string

--no-discard-stderr

include stderr when parsing option output

Include files

Additional material may be included in the generated output with the --include and --opt-include options. The format is simple:

[section]
text

/pattern/
text

Blocks of verbatim *roff text are inserted into the output either at the start of the given [section] (case insensitive), or after a paragraph matching /pattern/.

Patterns use the Perl regular expression syntax and may be followed by the i, s or m modifiers (see perlre(1)).

Lines before the first section or pattern which begin with `-' are processed as options. Anything else is silently ignored and may be used for comments, RCS keywords and the like.

The section output order (for those included) is:

NAME
SYNOPSIS
DESCRIPTION
OPTIONS
other
ENVIRONMENT
FILES
EXAMPLES
AUTHOR
REPORTING BUGS
COPYRIGHT
SEE ALSO

Any [NAME] or [SYNOPSIS] sections appearing in the include file will replace what would have automatically been produced (although you can still override the former with --name if required).

Other sections are prepended to the automatically produced output for the standard sections given above, or included at other (above) in the order they were encountered in the include file.

Placement of the text within the section may be explicitly requested by using the syntax [<section], [=section] or [>section] to place the additional text before, in place of, or after the default output respectively.

Releases

14 releases since Debian 2.2 (Potato); the text changed 10 times.

  1. 2.2
  2. 3.0
  3. 3.1
  4. 4.0–5.0
  5. 6.0
  6. 7
  7. 8
  8. 9
  9. 10
  10. 11
  11. 12–Arch

--help-option since Debian 3.0 (Woody); --info-page since Debian 3.1 (Sarge); --libtool since Debian 7 (Wheezy); --locale since Debian 3.1 (Sarge); --manual since Debian 3.0 (Woody); --no-discard-stderr since Debian 6.0 (Squeeze); --source since Debian 3.0 (Woody); --version-option since Debian 3.0 (Woody); --version-string since Debian 6.0 (Squeeze); -L since Debian 3.1 (Sarge); -S since Debian 3.0 (Woody); -h since Debian 3.0 (Woody); -l since Debian 7 (Wheezy); -m since Debian 3.0 (Woody); -p since Debian 3.1 (Sarge); -v since Debian 3.0 (Woody).

Availability

The latest version of this distribution is available on-line from:

ftp://ftp.gnu.org/gnu/help2man/

Author

Written by Brendan O'Dea <[email protected]>

Reporting bugs

Report bugs to <[email protected]>.

From help2man 1.49.3-2 in Arch Linux 2026-11-01. Parsed by carta from the page's man source.