Hash :
be77462a
Author :
Thomas de Grivel
Date :
2023-01-21T15:08:35
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257
\input texinfo @c -*-texinfo-*-
@c %**start of header
@setfilename help2man.info
@settitle @code{help2man} Reference Manual
@setchapternewpage odd
@finalout
@c %**end of header
@c $Id: help2man.texi,v 1.4 2000/07/07 06:15:03 bod Exp $
@dircategory GNU admin
@direntry
* help2man: (help2man). Automatic manual page generation.
@end direntry
@ifinfo
This file documents the GNU @code{help2man} command which produces
simple manual pages from the @samp{--help} and @samp{--version} output
of other commands.
Copyright (C) 1999, 2000 Free Software Foundation, Inc.
Permission is granted to make and distribute verbatim copies of
this manual provided the copyright notice and this permission notice
are preserved on all copies.
@ignore
Permission is granted to process this file through TeX and print the
results, provided the printed document carries copying permission
notice identical to this one except for the removal of this paragraph
(this paragraph not being relevant to the printed manual).
@end ignore
Permission is granted to copy and distribute modified versions of this
manual under the conditions for verbatim copying, provided that the entire
resulting derived work is distributed under the terms of a permission
notice identical to this one.
Permission is granted to copy and distribute translations of this manual
into another language, under the above conditions for modified versions,
except that this permission notice may be stated in a translation approved
by the Foundation.
@end ifinfo
@titlepage
@title help2man
@subtitle A utility for generating simple manual pages
@author Brendan O'Dea @email{bod@@compusol.com.au}
@page
@vskip 0pt plus 1filll
Copyright @copyright{} 1999, 2000 Free Software Foundation, Inc.
Permission is granted to make and distribute verbatim copies of
this manual provided the copyright notice and this permission notice
are preserved on all copies.
Permission is granted to copy and distribute modified versions of this
manual under the conditions for verbatim copying, provided that the entire
resulting derived work is distributed under the terms of a permission
notice identical to this one.
Permission is granted to copy and distribute translations of this manual
into another language, under the above conditions for modified versions,
except that this permission notice may be stated in a translation approved
by the Foundation.
@end titlepage
@ifinfo
@node Top
@top @code{help2man}
@code{help2man} produces simple manual pages from the @samp{--help}
and @samp{--version} output of other commands.
@menu
* Overview:: Overview of @code{help2man}.
* Invoking help2man:: How to run @code{help2man}.
* Including text:: Including additional text in the output.
* Makefile usage:: Using @code{help2man} with @code{make}.
* Reports:: Reporting bugs or suggestions.
* Availability:: Obtaining @code{help2man}.
@end menu
@end ifinfo
@node Overview
@chapter Overview of @code{help2man}
@code{help2man} is a tool for automatically generating simple manual
pages from program output.
Although manual pages are optional for GNU programs other projects,
such as Debian require them (@pxref{Man Pages, , , standards, The GNU
Coding Standards})
This program is intended to provide an easy way for software authors
to include a manual page in their distribution without having to
maintain that document.
Given a program which produces reasonably standard @samp{--help} and
@samp{--version} outputs, @code{help2man} can re-arrange that output
into something which resembles a manual page.
@node Invoking help2man
@chapter How to Run @code{help2man}.
The format for running the @code{help2man} program is:
@example
@code{help2man} [@var{option}]@dots{} @var{executable}
@end example
@code{help2man} supports the following options:
@table @samp
@item --name @var{string}
@itemx -n @var{string}
Use @var{string} as the description for the @samp{NAME} paragraph of
the manual page.
By default (for want of anything better) this paragraph contains
@samp{manual page for @var{program} @var{version}}.
This option overrides an include file @samp{[name]} section
(@xref{Including text}).
@item --section @var{section}
@itemx -s @var{section}
Use @var{section} as the section for the man page. The default
section is 1.
@item --include @var{file}
@itemx -i @var{file}
Include material from @var{file} (@xref{Including text}).
@item --opt-include @var{file}
@itemx -I @var{file}
A variant of @samp{--include} for use in Makefile pattern rules which
does not require @var{file} to exist.
@item --output @var{file}
@itemx -o @var{file}
Send output to @var{file} rather than @code{stdout}.
@item --no-info
@itemx -N
Suppress inclusion of a @samp{SEE ALSO} paragraph directing the reader
to the Texinfo documentation.
@item --help
@itemx --version
Show help or version information.
@end table
@node Including text
@chapter Including Additional Text in the Output
Additional static text may be included in the generated manual page by
using the @samp{--include} and @samp{--opt-include} options
(@xref{Invoking help2man}).
The format for files included with these option is simple:
@example
[section]
text
/pattern/
text
@end example
Blocks of verbatim *roff text are inserted into the output either at
the start of the given @samp{[section]} (case insensitive), or after a
paragraph matching @samp{/pattern/}.
Patterns use the Perl regular expression syntax and may be followed by
the @samp{i}, @samp{s} or @samp{m} modifiers (@pxref{perlre, ,
perlre(1), *manpages*, The @code{perlre(1)} manual page})
Anything before the first section or pattern is silently ignored and
may be used for comments, RCS keywords and the like.
The section output order is:
@example
NAME
SYNOPSIS
DESCRIPTION
OPTIONS
EXAMPLES
@emph{other}
AUTHOR
REPORTING BUGS
COPYRIGHT
SEE ALSO
@end example
Any @samp{[name]} or @samp{[synopsis]} sections appearing in the
include file will replace what would have automatically been produced
(although you can still override the former with @samp{--name} if
required).
Other sections are prepended to the automatically produced output for
the standard sections given above, or included at @emph{other} (above)
in the order they were encountered in the include file.
@node Makefile usage
@chapter Using @code{help2man} With @code{make}
A suggested use of @code{help2man} in Makefiles is to have the manual
page depend not on the binary, but on the source file(s) in which the
@samp{--help} and @samp{--version} output are defined.
This usage allows a manual page to be generated by the maintainer and
included in the distribution without requiring the end-user to have
@code{help2man} installed.
An example rule for the program @code{prog} could be:
@example
@group
prog.1: $(srcdir)/main.c
-$(HELP2MAN) --output=$@@ --name='an example program' ./prog
@end group
@end example
The value of @code{HELP2MAN} may be set in @code{configure.in} using
either of:
@example
AM_MISSING_PROG(HELP2MAN, help2man, $missing_dir)
@end example
for @code{automake}, or something like:
@example
AC_PATH_PROG(HELP2MAN, help2man, false // No help2man //)
@end example
for @code{autoconf} alone.
@node Reports
@chapter Reporting Bugs or Suggestions
If you find problems or have suggestions about this program or
manual, please report them to @email{bug-help2man@@gnu.org}.
@node Availability
@chapter Obtaining @code{help2man}
The latest version of this distribution is available on-line from:
@example
@url{ftp://ftp.gnu.org/gnu/help2man/}
@end example
@contents
@bye