Commit 9a4436338f00a763ec96e25d415a5e4b052f3e8b

Thomas de Grivel 2023-01-21T15:08:36

help2man-1.25

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
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
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