Re: [PATCH] Re: INSTALLSCRIPT versus INSTALLDIRS
[p5sagit/p5-mst-13.2.git] / pod / pod2man.PL
index 5a1deea..5a78c01 100644 (file)
@@ -36,7 +36,7 @@ $Config{startperl}
 print OUT <<'!NO!SUBS!';
 
 # pod2man -- Convert POD data to formatted *roff input.
-# $Id: pod2man.PL,v 1.7 2001/10/20 08:24:15 eagle Exp $
+# $Id: pod2man.PL,v 1.14 2004/12/31 20:39:30 eagle Exp $
 #
 # Copyright 1999, 2000, 2001 by Russ Allbery <rra@stanford.edu>
 #
@@ -55,8 +55,7 @@ use strict;
 use vars qw($running_under_some_shell);
 
 # Insert -- into @ARGV before any single dash argument to hide it from
-# Getopt::Long; we want to interpret it as meaning stdin (which Pod::Parser
-# does correctly).
+# Getopt::Long; we want to interpret it as meaning stdin.
 my $stdin;
 @ARGV = map { $_ eq '-' && !$stdin++ ? ('--', $_) : $_ } @ARGV;
 
@@ -64,10 +63,10 @@ my $stdin;
 # allowing short forms as well.  --lax is currently ignored.
 my %options;
 Getopt::Long::config ('bundling_override');
-GetOptions (\%options, 'section|s=s', 'release|r=s', 'center|c=s',
+GetOptions (\%options, 'section|s=s', 'release|r:s', 'center|c=s',
             'date|d=s', 'fixed=s', 'fixedbold=s', 'fixeditalic=s',
-            'fixedbolditalic=s', 'official|o', 'quotes|q=s', 'lax|l',
-            'help|h', 'verbose|v') or exit 1;
+            'fixedbolditalic=s', 'name|n=s', 'official|o', 'quotes|q=s',
+            'lax|l', 'help|h', 'verbose|v') or exit 1;
 pod2usage (0) if $options{help};
 
 # Official sets --center, but don't override things explicitly set.
@@ -79,11 +78,15 @@ if ($options{official} && !defined $options{center}) {
 my $verbose = $options{verbose};
 delete $options{verbose};
 
+# This isn't a valid Pod::Man option and is only accepted for backwards
+# compatibility.
+delete $options{lax};
+
 # Initialize and run the formatter, pulling a pair of input and output off at
 # a time.
-my $parser = Pod::Man->new (%options);
 my @files;
 do {
+    my $parser = Pod::Man->new (%options);
     @files = splice (@ARGV, 0, 2);
     print "  $files[1]\n" if $verbose;
     $parser->parse_from_file (@files);
@@ -97,11 +100,12 @@ pod2man - Convert POD data to formatted *roff input
 
 =head1 SYNOPSIS
 
-pod2man [B<--section>=I<manext>] [B<--release>=I<version>]
+pod2man [B<--section>=I<manext>] [B<--release>[=I<version>]]
 [B<--center>=I<string>] [B<--date>=I<string>] [B<--fixed>=I<font>]
 [B<--fixedbold>=I<font>] [B<--fixeditalic>=I<font>]
-[B<--fixedbolditalic>=I<font>] [B<--official>] [B<--lax>]
-[B<--quotes>=I<quotes>] [B<--verbose>] [I<input> [I<output>] ...]
+[B<--fixedbolditalic>=I<font>] [B<--name>=I<name>] [B<--official>]
+[B<--lax>] [B<--quotes>=I<quotes>] [B<--verbose>]
+[I<input> [I<output>] ...]
 
 pod2man B<--help>
 
@@ -182,8 +186,22 @@ Print out usage information.
 
 =item B<-l>, B<--lax>
 
-Don't complain when required sections are missing.  Not currently used, as
-POD checking functionality is not yet implemented in Pod::Man.
+No longer used.  B<pod2man> used to check its input for validity as a manual
+page, but this should now be done by L<podchecker(1)> instead.  Accepted for
+backwards compatibility; this option no longer does anything.
+
+=item B<-n> I<name>, B<--name>=I<name>
+
+Set the name of the manual page to I<name>.  Without this option, the manual
+name is set to the uppercased base name of the file being converted unless
+the manual section is 3, in which case the path is parsed to see if it is a
+Perl module path.  If it is, a path like C<.../lib/Pod/Man.pm> is converted
+into a name like C<Pod::Man>.  This option, if given, overrides any
+automatic determination of the name.
+
+Note that this option is probably not useful when converting multiple POD
+files at once.  The convention for Unix man pages for commands is for the
+man page title to be in all-uppercase even if the command isn't.
 
 =item B<-o>, B<--official>
 
@@ -233,7 +251,7 @@ Print out the name of each output file as it is being generated.
 
 =head1 DIAGNOSTICS
 
-If B<pod2man> fails with errors, see L<Pod::Man> and L<Pod::Parser> for
+If B<pod2man> fails with errors, see L<Pod::Man> and L<Pod::Simple> for
 information about what those errors might mean.
 
 =head1 EXAMPLES
@@ -260,8 +278,6 @@ L<Pod::Man> for more details.
 
 Lots of this documentation is duplicated from L<Pod::Man>.
 
-POD checking and the corresponding B<--lax> option don't work yet.
-
 =head1 NOTES
 
 For those not sure of the proper layout of a man page, here are some notes
@@ -425,21 +441,6 @@ Bugs you don't plan to fix.  :-)
 
 Miscellaneous commentary.
 
-=item SEE ALSO
-
-Other man pages to check out, like man(1), man(7), makewhatis(8), or
-catman(8).  Normally a simple list of man pages separated by commas, or a
-paragraph giving the name of a reference work.  Man page references, if they
-use the standard C<name(section)> form, don't have to be enclosed in
-LE<lt>E<gt>, but other things in this section probably should be when
-appropriate.  You may need to use the C<LE<lt>...|...E<gt>> syntax to keep
-B<pod2man> and B<pod2text> from being too verbose; see perlpod(1).
-
-If the package has a mailing list, include a URL or subscription
-instructions here.
-
-If the package has a web site, include a URL here.
-
 =item AUTHOR
 
 Who wrote it (use AUTHORS for multiple people).  Including your current
@@ -448,6 +449,12 @@ so that users have a way of contacting you is a good idea.  Remember that
 program documentation tends to roam the wild for far longer than you expect
 and pick an e-mail address that's likely to last if possible.
 
+=item HISTORY
+
+Programs derived from other sources sometimes have this, or you might keep
+a modification log here.  If the log gets overly long or detailed,
+consider maintaining it in a separate file, though.
+
 =item COPYRIGHT AND LICENSE
 
 For copyright
@@ -465,11 +472,19 @@ This makes it easy for people to use your module with Perl.  Note that
 this licensing is neither an endorsement or a requirement, you are of
 course free to choose any licensing.
 
-=item HISTORY
+=item SEE ALSO
 
-Programs derived from other sources sometimes have this, or you might keep
-a modification log here.  If the log gets overly long or detailed,
-consider maintaining it in a separate file, though.
+Other man pages to check out, like man(1), man(7), makewhatis(8), or
+catman(8).  Normally a simple list of man pages separated by commas, or a
+paragraph giving the name of a reference work.  Man page references, if they
+use the standard C<name(section)> form, don't have to be enclosed in
+LE<lt>E<gt> (although it's recommended), but other things in this section
+probably should be when appropriate.
+
+If the package has a mailing list, include a URL or subscription
+instructions here.
+
+If the package has a web site, include a URL here.
 
 =back
 
@@ -495,19 +510,23 @@ function names, man page references, and the like unadorned by markup and
 the POD translators will figure it out for you.  This makes it much easier
 to later edit the documentation.  Note that many existing translators
 (including this one currently) will do the wrong thing with e-mail addresses
-or URLs when wrapped in LE<lt>E<gt>, so don't do that.
+when wrapped in LE<lt>E<gt>, so don't do that.
 
 For additional information that may be more accurate for your specific
-system, see either man(5) or man(7) depending on your system manual section
-numbering conventions.
+system, see either L<man(5)> or L<man(7)> depending on your system manual
+section numbering conventions.
 
 =head1 SEE ALSO
 
-L<Pod::Man|Pod::Man>, L<Pod::Parser|Pod::Parser>, man(1), nroff(1),
-troff(1), man(7)
+L<Pod::Man>, L<Pod::Simple>, L<man(1)>, L<nroff(1)>, L<podchecker(1)>,
+L<troff(1)>, L<man(7)>
+
+The man page documenting the an macro set may be L<man(5)> instead of
+L<man(7)> on your system.
 
-The man page documenting the an macro set may be man(5) instead of man(7) on
-your system.
+The current version of this script is always available from its web site at
+L<http://www.eyrie.org/~eagle/software/podlators/>.  It is also part of the
+Perl core distribution as of 5.6.0.
 
 =head1 AUTHOR