diff --git a/ChangeLog b/ChangeLog
index f0afc7e..cb90a2f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+Mon Dec 3 19:02:26 2001 Brendan O'Dea <bod@debian.org>
+
+ * README.sh: Change email address
+ * configure.in: Require perl 5.005
+ * help2man.PL, help2man.texi: Add --source, --manual, --help-option
+ and --version-option; change email address; update copyright
+
Fri Dec 22 23:17:11 2000 Brendan O'Dea <bod@compusol.com.au>
* help2man.PL: Process options given in the block before the first
diff --git a/NEWS b/NEWS
index 17de795..f459960 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,11 @@
+Version 1.25 December 3, 2001
+
+ * New --source and --manual options to allow the page headers and
+ footers to be specified.
+
+ * New --help-option and --version-option options to cater for programs
+ which don't support the standard --help and --version.
+
Version 1.24 December 22, 2000
* Allow options to be specified in the initial block of include files.
diff --git a/README b/README
index bfb77ce..5044365 100644
--- a/README
+++ b/README
@@ -1,16 +1,16 @@
README for GNU help2man
- version 1.24
- December 22, 2000
+ version 1.25
+ December 3, 2001
help2man is a script to create simple man pages from the --help and
--version output of programs.
http://www.gnu.org/software/help2man/
- ftp://ftp.gnu.org/gnu/help2man/help2man-1.24.tar.gz
+ ftp://ftp.gnu.org/gnu/help2man/help2man-1.25.tar.gz
Since most GNU documentation is now in info format, this provides a
way to generate a placeholder man page pointing to that resource while
still providing some useful information.
--
-Brendan O'Dea <bod@compusol.com.au>
+Brendan O'Dea <bod@debian.org>
diff --git a/THANKS b/THANKS
index 1f964df..3b98af8 100644
--- a/THANKS
+++ b/THANKS
@@ -13,5 +13,6 @@ Peter Moulder <reiter@netspace.net.au>
François Pinard <pinard@iro.umontreal.ca>
Andreas Schwab <schwab@ls5.informatik.uni-dortmund.de>
Patrick Tullmann <tullmann@cs.utah.edu>
+Christopher Yeoh <cyeoh@users.sourceforge.net>
Okuji Yoshinori <okuji@kuicr.kyoto-u.ac.jp>
suzukis <suzukis@cmpt.phys.tohoku.ac.jp>
diff --git a/configure b/configure
index ba94ed2..bf78fde 100755
--- a/configure
+++ b/configure
@@ -527,7 +527,7 @@ echo "configure:527: checking for perl" >&5
if eval "test \"`echo '$''{'ac_cv_prog_PERL'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
- echo "configure:531: ...version 5.004 required" >&5
+ echo "configure:531: ...version 5.005 required" >&5
# allow user to override
if test -n "$PERL"; then
ac_try="$PERL"
@@ -537,7 +537,7 @@ else
for ac_prog in $ac_try; do
echo "configure:540: trying $ac_prog" >&5
- if ($ac_prog -e 'printf "found version %g\n",$];exit($]<5.004)') 1>&5 2>&1; then
+ if ($ac_prog -e 'printf "found version %g\n",$];exit($]<5.005)') 1>&5 2>&1; then
ac_cv_prog_PERL=$ac_prog
break
fi
@@ -550,7 +550,7 @@ else
echo "$ac_t""no" 1>&6
fi
-test -z "$PERL" && { echo "configure: error: perl 5.004 required" 1>&2; exit 1; }
+test -z "$PERL" && { echo "configure: error: perl 5.005 required" 1>&2; exit 1; }
ac_aux_dir=
for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
if test -f $ac_dir/install-sh; then
diff --git a/configure.in b/configure.in
index 3b01831..e1da891 100644
--- a/configure.in
+++ b/configure.in
@@ -1,9 +1,9 @@
dnl Process this file with autoconf to produce a configure script.
-dnl $Id: configure.in,v 1.3 2000/07/07 06:11:29 bod Exp $
+dnl $Id: configure.in,v 1.4 2001/12/03 07:32:05 bod Exp $
AC_INIT(help2man.PL)
-AC_PROG_PERL(5.004)
-test -z "$PERL" && AC_MSG_ERROR([perl 5.004 required])
+AC_PROG_PERL(5.005)
+test -z "$PERL" && AC_MSG_ERROR([perl 5.005 required])
AC_PROG_INSTALL
AC_PATH_PROG(MAKEINFO, makeinfo)
AC_PATH_PROG(INSTALL_INFO, install-info)
diff --git a/help2man.PL b/help2man.PL
index e09eb25..d70fa0c 100755
--- a/help2man.PL
+++ b/help2man.PL
@@ -11,12 +11,12 @@
# *script not created
#
-use 5.004;
+use 5.005;
use Config;
use Getopt::Long;
my ($program, $version)
- = (qw$Id: help2man.PL,v 1.24 2000/12/22 12:17:11 bod Exp $)[1..2];
+ = (qw$Id: help2man.PL,v 1.25 2001/12/03 08:01:55 bod Exp $)[1..2];
$program =~ s/\.PL(,v)?$//;
@@ -59,7 +59,7 @@ eval 'exec $Config{perlpath} -wS \$0 \${1+"\$@"}'
print OUT <<'!NO!SUBS!';
# Generate a short man page from --help and --version output.
-# Copyright © 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
+# Copyright © 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -75,10 +75,10 @@ print OUT <<'!NO!SUBS!';
# along with this program; if not, write to the Free Software Foundation,
# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-# Written by Brendan O'Dea <bod@compusol.com.au>
+# Written by Brendan O'Dea <bod@debian.org>
# Available from ftp://ftp.gnu.org/gnu/help2man/
-use 5.004;
+use 5.005;
use strict;
use Getopt::Long;
use Text::Tabs qw(expand);
@@ -97,11 +97,11 @@ print OUT <<'!NO!SUBS!';
my $version_info = <<EOT;
GNU $this_program $this_version
-Copyright (C) 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
+Copyright (C) 1997, 1998, 1999, 2000, 2001 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 <bod\@compusol.com.au>
+Written by Brendan O'Dea <bod\@debian.org>
EOT
my $help_info = <<EOT;
@@ -109,8 +109,10 @@ my $help_info = <<EOT;
Usage: $this_program [OPTION]... EXECUTABLE
- -n, --name=STRING use `STRING' as the description for the NAME paragraph
- -s, --section=SECTION use `SECTION' as the section for the man page
+ -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, ...)
-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'
@@ -118,20 +120,33 @@ Usage: $this_program [OPTION]... EXECUTABLE
--help print this help, then exit
--version print version number, then exit
-EXECUTABLE should accept `--help' and `--version' options.
+EXECUTABLE should accept `--help' and `--version' options although
+alternatives may be specified using:
+
+ -h, --help-option=STRING help option string
+ -v, --version-option=STRING version option string
Report bugs to <bug-help2man\@gnu.org>.
EOT
my $section = 1;
+my $manual = '';
+my $source = '';
+my $help_option = '--help';
+my $version_option = '--version';
my ($opt_name, @opt_include, $opt_output, $opt_no_info);
+
my %opt_def = (
- 'n|name=s' => \$opt_name,
- 's|section=s' => \$section,
- 'i|include=s' => sub { push @opt_include, [ pop, 1 ] },
- 'I|opt-include=s' => sub { push @opt_include, [ pop, 0 ] },
- 'o|output=s' => \$opt_output,
- 'N|no-info' => \$opt_no_info,
+ 'n|name=s' => \$opt_name,
+ 's|section=s' => \$section,
+ 'm|manual=s' => \$manual,
+ 'S|source=s' => \$source,
+ 'i|include=s' => sub { push @opt_include, [ pop, 1 ] },
+ 'I|opt-include=s' => sub { push @opt_include, [ pop, 0 ] },
+ 'o|output=s' => \$opt_output,
+ 'N|no-info' => \$opt_no_info,
+ 'h|help-option=s' => \$help_option,
+ 'v|version-option=s' => \$version_option,
);
# Parse options.
@@ -147,9 +162,6 @@ my %include = ();
my %append = ();
my @include = (); # retain order given in include file
-# Provide replacement `quote-regex' operator for pre-5.005.
-BEGIN { eval q(sub qr { '' =~ $_[0]; $_[0] }) if $] < 5.005 }
-
# Process include file (if given). Format is:
#
# [section name]
@@ -241,9 +253,9 @@ setlocale LC_TIME, 'C';
# Grab help and version info from executable.
my ($help_text, $version_text) = map {
- join '', map { s/ +$//; expand $_ } `$ARGV[0] --$_ 2>/dev/null`
- or die "$this_program: can't get `--$_' info from $ARGV[0]\n"
-} qw(help version);
+ join '', map { s/ +$//; expand $_ } `$ARGV[0] $_ 2>/dev/null`
+ or die "$this_program: can't get `$_' info from $ARGV[0]\n"
+} $help_option, $version_option;
my $date = strftime "%B %Y", localtime;
(my $program = $ARGV[0]) =~ s!.*/!!;
@@ -305,6 +317,18 @@ $include{NAME} ||= "$program \\- manual page for $program $version\n";
# Man pages traditionally have the page title in caps.
my $PROGRAM = uc $program;
+# Set default page head/footers
+$source ||= "$program $version";
+unless ($manual)
+{
+ for ($section)
+ {
+ if (/^(1[Mm]|8)/) { $manual = 'System Administration Utilities' }
+ elsif (/^6/) { $manual = 'Games' }
+ else { $manual = 'User Commands' }
+ }
+}
+
# Extract usage clause(s) [if any] for SYNOPSIS.
if ($help_text =~ s/^Usage:( +(\S+))(.*)((?:\n(?: {6}\1| *or: +\S).*)*)//m)
{
@@ -549,7 +573,7 @@ EOT
# Output header.
print <<EOT;
.\\" DO NOT MODIFY THIS FILE! It was generated by $this_program $this_version.
-.TH $PROGRAM "$section" "$date" "$package $version" FSF
+.TH $PROGRAM "$section" "$date" "$source" "$manual"
EOT
# Section ordering.
diff --git a/help2man.info b/help2man.info
index 220ca43..1b8ed64 100644
--- a/help2man.info
+++ b/help2man.info
@@ -9,7 +9,7 @@ END-INFO-DIR-ENTRY
This file documents the GNU `help2man' command which produces simple
manual pages from the `--help' and `--version' output of other commands.
- Copyright (C) 1999, 2000 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2000, 2001 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
@@ -75,8 +75,8 @@ How to Run `help2man'.
`help2man' supports the following options:
-`--name STRING'
`-n STRING'
+`--name=STRING'
Use STRING as the description for the `NAME' paragraph of the
manual page.
@@ -86,26 +86,39 @@ How to Run `help2man'.
This option overrides an include file `[name]' section (*note
Including text::.).
-`--section SECTION'
`-s SECTION'
+`--section SECTION'
Use SECTION as the section for the man page. The default section
is 1.
-`--include FILE'
+`-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.
+
`-i FILE'
+`--include=FILE'
Include material from FILE (*note Including text::.).
-`--opt-include FILE'
`-I FILE'
+`--opt-include=FILE'
A variant of `--include' for use in Makefile pattern rules which
does not require FILE to exist.
-`--output FILE'
`-o FILE'
+`--output=FILE'
Send output to FILE rather than `stdout'.
-`--no-info'
`-N'
+`--no-info'
Suppress inclusion of a `SEE ALSO' paragraph directing the reader
to the Texinfo documentation.
@@ -113,6 +126,17 @@ How to Run `help2man'.
`--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
+
File: help2man.info, Node: Including text, Next: Makefile usage, Prev: Invoking help2man, Up: Top
@@ -214,12 +238,12 @@ Obtaining `help2man'
Tag Table:
-Node: Top1100
-Node: Overview1664
-Node: Invoking help2man2370
-Node: Including text3576
-Node: Makefile usage5110
-Node: Reports6028
-Node: Availability6303
+Node: Top1106
+Node: Overview1670
+Node: Invoking help2man2376
+Node: Including text4374
+Node: Makefile usage5908
+Node: Reports6826
+Node: Availability7101
End Tag Table
diff --git a/help2man.texi b/help2man.texi
index f6e780d..5a717e8 100644
--- a/help2man.texi
+++ b/help2man.texi
@@ -1,11 +1,9 @@
\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.5 2000/12/22 12:15:21 bod Exp $
+@c $Id: help2man.texi,v 1.6 2001/12/03 08:02:26 bod Exp $
@dircategory GNU admin
@direntry
@@ -17,7 +15,7 @@ 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.
+Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc.
Permission is granted to make and distribute verbatim copies of
this manual provided the copyright notice and this permission notice
@@ -44,11 +42,11 @@ by the Foundation.
@titlepage
@title help2man
@subtitle A utility for generating simple manual pages
-@author Brendan O'Dea @email{bod@@compusol.com.au}
+@author Brendan O'Dea @email{bod@@debian.org}
@page
@vskip 0pt plus 1filll
-Copyright @copyright{} 1999, 2000 Free Software Foundation, Inc.
+Copyright @copyright{} 1999, 2000, 2001 Free Software Foundation, Inc.
Permission is granted to make and distribute verbatim copies of
this manual provided the copyright notice and this permission notice
@@ -112,8 +110,8 @@ The format for running the @code{help2man} program is:
@code{help2man} supports the following options:
@table @samp
-@item --name @var{string}
-@itemx -n @var{string}
+@item -n @var{string}
+@itemx --name=@var{string}
Use @var{string} as the description for the @samp{NAME} paragraph of
the manual page.
@@ -123,26 +121,39 @@ By default (for want of anything better) this paragraph contains
This option overrides an include file @samp{[name]} section
(@pxref{Including text}).
-@item --section @var{section}
-@itemx -s @var{section}
+@item -s @var{section}
+@itemx --section @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}
+@item -m @var{manual}
+@itemx --manual=@var{manual}
+Set the name of the manual section to @var{section}, used as a centred
+heading for the manual page. By default @samp{User Commands} is used
+for pages in section 1, @samp{Games} for section 6 and @samp{System
+Administration Utilities} for sections 8 and 1M.
+
+@item -S @var{source}
+@itemx --source=@var{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.
+
+@item -i @var{file}
+@itemx --include=@var{file}
Include material from @var{file} (@pxref{Including text}).
-@item --opt-include @var{file}
-@itemx -I @var{file}
+@item -I @var{file}
+@itemx --opt-include=@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}
+@item -o @var{file}
+@itemx --output=@var{file}
Send output to @var{file} rather than @code{stdout}.
-@item --no-info
-@itemx -N
+@item -N
+@itemx --no-info
Suppress inclusion of a @samp{SEE ALSO} paragraph directing the reader
to the Texinfo documentation.
@@ -151,6 +162,20 @@ to the Texinfo documentation.
Show help or version information.
@end table
+By default @code{help2man} passes the standard @samp{--help} and
+@samp{--version} options to the executable although alternatives may
+be specified using:
+
+@table @samp
+@item -h @var{option}
+@itemx --help-option=@var{option}
+help option string
+
+@item -v @var{option}
+@itemx --version-option=@var{option}
+version option string
+@end table
+
@node Including text
@chapter Including Additional Text in the Output