A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
-bash/zsh: help2man command not not found # Windows (WSL2) sudo apt-get update sudo apt-get install help2man # Debian apt-get install help2man # Ubuntu apt-get install help2man # Alpine apk add help2man # Arch Linux pacman -S help2man # Kali Linux apt-get install help2man # CentOS yum install help2man # Fedora dnf install help2man # OS X brew install help2man # Raspbian apt-get install help2man # Dockerfile dockerfile.run/help2man # Docker docker run cmd.cat/help2man help2man
help2man 是一款用于根据程序输出自动生成简单手册页的工具。
虽然手册页对于 GNU 程序来说是可选的,但其他项目(例如 Debian)则需要它们(参见 GNU 编码标准中的手册页)。help2man 旨在为软件作者提供一种简便的方法,让他们能够将手册页添加到其发行版中,而无需维护该文档。
假设一个程序能够生成相当标准的 --help 和 --version 输出,help2man 可以将其输出重新整理成类似于手册页的内容。
help2man [option]… executable
-n string’ ‘--name=string’ Use string as the description for the ‘NAME’ paragraph of the manual page. By default (for want of anything better) this paragraph contains ‘manual page for program version’. This option overrides an include file ‘[name]’ section (see Including text). ‘-s section’ ‘--section section’ Use section as the section for the man page. The default section is 1. ‘-m manual’ ‘--manual=manual’ Set the name of the manual section to section, used as a centred heading for the manual page. By default ‘User Commands’ is used for pages in section 1, ‘Games’ for section 6 and ‘System Administration Utilities’ for sections 8 and 1M. ‘-S source’ ‘--source=source’ The program source is used as a page footer, and often contains the name of the organisation or a suite of which the program is part. By default the value is the package name and version. ‘-L locale’ ‘--locale=locale’ Select output locale (default ‘C’). Both the program and help2man must support the given locale (see Localised man pages). ‘-i file’ ‘--include=file’ Include material from file (see Including text). ‘-I file’ ‘--opt-include=file’ A variant of ‘--include’ for use in Makefile pattern rules which does not require file to exist. ‘-o file’ ‘--output=file’ Send output to file rather than stdout. ‘-p text’ ‘--info-page=text’ Name of Texinfo manual. ‘-N’ ‘--no-info’ Suppress inclusion of a ‘SEE ALSO’ paragraph directing the reader to the Texinfo documentation. ‘-l’ ‘--libtool’ Drop lt- prefix from instances of the program name in the synopsis (libtool creates wrapper scripts in the build directory which invoke foo as .libs/lt-foo). ‘--help’ ‘--version’ Show help or version information. By default help2man passes the standard ‘--help’ and ‘--version’ options to the executable although alternatives may be specified using: ‘-h option’ ‘--help-option=option’ Help option string. ‘-v option’ ‘--version-option=option’ Version option string. ‘--version-string=string’ Version string. ‘--no-discard-stderr’ Include stderr when parsing option output.
help2man 为可执行文件生成手册页:
help2man executable
help2man 在手册页中指定 名称 - name 段落:
help2man executable --name name
help2man 指定手册页的部分(默认为 1):
help2man executable --section section
help2man 输出到文件而不是 stdout:
help2man executable --output path/to/file
help2man 显示详细帮助:
help2man --help