help2man
help2man is a program that converts the output of
standard --help
and --version
command-line
arguments into a manual page automatically. It lets developers include
a manual page in their distribution without having to maintain that
document. Since Texinfo is the official documentation format
of the GNU Project, this also provides a way to generate a
placeholder man page pointing to that resource while still providing some
useful information.
Useful Links:
- help2man Reference Manual
Download
GNU help2man can be found on http://ftp.gnu.org/gnu/help2man/. Use the
wget
command to download the file.
cd ~/Downloads wget http://ftp.gnu.org/gnu/help2man/help2man-1.47.3.tar.xz
The output should look like this:
--2016-05-02 08:09:40-- http://ftp.gnu.org/gnu/help2man/help2man-1.47.3.tar.xz Resolving ftp.gnu.org (ftp.gnu.org)... 2001:4830:134:3::b, 208.118.235.20 Connecting to ftp.gnu.org (ftp.gnu.org)|2001:4830:134:3::b|:80... connected. HTTP request sent, awaiting response... 200 OK Length: 184832 (180K) [application/x-tar] Saving to: 'help2man-1.47.3.tar.xz' 100%[======================================>] 184,832 468KB/s in 0.4s 2016-05-02 08:09:40 (468 KB/s) - 'help2man-1.47.3.tar.xz' saved [184832/184832]
This will download the tar
file to your
/home/[user]/Downloads
directory. Verify the download.
ls -la
This should return something like:
total 188 drwxr-xr-x. 2 root root 35 May 2 08:09 . dr-xr-x---. 17 root root 4096 May 2 07:22 .. -rw-r--r-- 1 root root 184832 Nov 18 03:09 help2man-1.47.3.tar.xz
Next, uncompress the file.
unxz help2man-1.47.3.tar.xz tar -xf help2man-1.47.3.tar
Move the help2man files to the /usr/local/help2man
directory.
sudo mv /root/Downloads/help2man-1.47.3 /usr/local/help2man ls -la /usr/local/help2man
This should return something like:
total 588 drwxr-xr-x 6 root root 4096 Nov 18 02:47 . drwxr-xr-x. 18 root root 4096 May 2 08:17 .. -rw-r--r-- 1 root root 1906 Jul 25 2014 aclocal.m4 -rw-r--r-- 1 root root 2404 Dec 29 2012 bindtextdomain.c drwxr-xr-x 2 root root 138 Nov 18 02:47 build-aux lrwxrwxrwx 1 root root 16 Nov 18 02:47 ChangeLog -> debian/changelog -rwxr-xr-x 1 root root 129040 Nov 18 02:47 configure -rw-r--r-- 1 root root 2165 Jul 25 2014 configure.ac -rw-r--r-- 1 root root 35147 Nov 18 02:47 COPYING drwxr-xr-x 3 root root 129 Nov 18 02:47 debian -rw-r--r-- 1 root root 4097 Nov 18 02:47 help2man.1 -rw-r--r-- 1 root root 4042 Nov 18 02:47 help2man.da.1 -rw-r--r-- 1 root root 4644 Nov 18 02:47 help2man.de.1 -rw-r--r-- 1 root root 21083 Nov 18 02:47 help2man-de.info -rw-r--r-- 1 root root 6255 Nov 18 02:47 help2man.el.1 -rw-r--r-- 1 root root 4190 Nov 18 02:47 help2man.eo.1 -rw-r--r-- 1 root root 4586 Nov 18 02:47 help2man.es.1 -rw-r--r-- 1 root root 20237 Nov 18 02:47 help2man-es.info -rw-r--r-- 1 root root 4412 Nov 18 02:47 help2man.fi.1 -rw-r--r-- 1 root root 4974 Nov 18 02:47 help2man.fr.1 -rw-r--r-- 1 root root 20947 Nov 18 02:47 help2man-fr.info -rwxr-xr-x 1 root root 5042 Oct 9 2014 help2man.h2m.PL -rw-r--r-- 1 root root 4221 Nov 18 02:47 help2man.hr.1 -rwxr-xr-x 1 root root 2723 Dec 29 2012 help2man.html.PL -rw-r--r-- 1 root root 4201 Nov 18 02:47 help2man.hu.1 -rw-r--r-- 1 root root 18025 Nov 18 02:47 help2man.info -rw-r--r-- 1 root root 4496 Nov 18 02:47 help2man.it.1 -rw-r--r-- 1 root root 5768 Nov 18 02:47 help2man.ja.1 -rw-r--r-- 1 root root 4248 Nov 18 02:47 help2man.nb.1 -rwxr-xr-x 1 root root 23141 Nov 1 22:30 help2man.PL -rw-r--r-- 1 root root 4454 Nov 18 02:47 help2man.pl.1 -rw-r--r-- 1 root root 19946 Nov 18 02:47 help2man-pl.info -rw-r--r-- 1 root root 4474 Nov 18 02:47 help2man.pt_BR.1 -rw-r--r-- 1 root root 6577 Nov 18 02:47 help2man.ru.1 -rw-r--r-- 1 root root 6360 Nov 18 02:47 help2man.sr.1 -rw-r--r-- 1 root root 4184 Nov 18 02:47 help2man.sv.1 -rw-r--r-- 1 root root 18984 Jun 8 2015 help2man.texi -rw-r--r-- 1 root root 7211 Nov 18 02:47 help2man.uk.1 -rw-r--r-- 1 root root 30581 Nov 18 02:47 help2man-uk.info -rw-r--r-- 1 root root 5428 Nov 18 02:47 help2man.vi.1 -rw-r--r-- 1 root root 3781 Nov 18 02:47 help2man.zh_CN.1 -rw-r--r-- 1 root root 15752 Nov 18 02:47 INSTALL -rw-r--r-- 1 root root 303 Sep 11 2015 locales -rw-r--r-- 1 root root 7627 Nov 18 02:34 Makefile.in -rw-r--r-- 1 root root 5307 Jun 15 2015 NEWS drwxr-xr-x 2 root root 4096 Nov 18 02:47 po drwxr-xr-x 2 root root 90 Nov 18 02:47 po-texi -rw-r--r-- 1 root root 566 Nov 18 02:47 README -rw-r--r-- 1 root root 2761 Sep 11 2015 THANKS
Issue the following commands:
cd /usr/local/help2man ./configure
This will generate some output:
checking for perl... perl checking for module Locale::gettext... no checking for msgfmt... /usr/bin/msgfmt checking for gcc... gcc checking whether the C compiler works... yes checking for C compiler default output file name... a.out checking for suffix of executables... checking whether we are cross compiling... no checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ISO C89... none needed checking for library containing dlsym... -ldl checking for library containing bindtextdomain... none required checking for a BSD-compatible install... /usr/bin/install -c checking for makeinfo... build-aux/missing makeinfo checking for install-info... /usr/sbin/install-info checking for msgmerge... /usr/bin/msgmerge checking for xgettext... /usr/bin/xgettext checking for po4a-updatepo... build-aux/missing po4a-updatepo checking for po4a-translate... build-aux/missing po4a-translate configure: creating ./config.status config.status: creating Makefile
Issue the following command:
make
This will generate some output:
perl help2man.PL Extracting help2man (with variable substitutions)
Issue the following command:
make install
This will generate some output:
build-aux/mkinstalldirs /usr/local/bin build-aux/mkinstalldirs /usr/local/lib/help2man mkdir -p -- /usr/local/lib/help2man build-aux/mkinstalldirs /usr/local/share/man/man1 build-aux/mkinstalldirs /usr/local/share/info /usr/bin/install -c help2man /usr/local/bin /usr/bin/install -c -m 644 $(build-aux/find-vpath help2man.1) /usr/local/share/man/man1 /usr/bin/install -c -m 644 $(build-aux/find-vpath help2man.info) \ /usr/local/share/info/help2man.info if test -f /usr/local/share/info/dir; \ then \ /usr/sbin/install-info --info-dir=/usr/local/share/info \ /usr/local/share/info/help2man.info; \ fi
To verify the help2man installation, use the following command:
help2man --version
This will generate some output:
GNU help2man 1.47.3 Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2009, 2010, 2011, 2012, 2013, 2014, 2015 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Written by Brendan O'Dea <[email protected]>
Here is the output from the help command:
help2man --help
This will generate some output:
`help2man' generates a man page out of `--help' and `--version' output. Usage: help2man [OPTION]... EXECUTABLE -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 Report bugs to <[email protected]>.