[patch] re_dup
[p5sagit/p5-mst-13.2.git] / pod / pod2man.PL
index bf35cff..cef507b 100644 (file)
@@ -36,11 +36,11 @@ $Config{startperl}
 print OUT <<'!NO!SUBS!';
 
 # pod2man -- Convert POD data to formatted *roff input.
-# $Id: pod2man.PL,v 1.2 2000/03/16 21:08:23 eagle Exp $
+# $Id: pod2man.PL,v 1.6 2001/07/10 11:23:46 eagle Exp $
 #
-# Copyright 1999, 2000 by Russ Allbery <rra@stanford.edu>
+# Copyright 1999, 2000, 2001 by Russ Allbery <rra@stanford.edu>
 #
-# This program is free software; you can redistribute it and/or modify it
+# This program is free software; you may redistribute it and/or modify it
 # under the same terms as Perl itself.
 
 require 5.004;
@@ -57,13 +57,14 @@ use strict;
 my $stdin;
 @ARGV = map { $_ eq '-' && !$stdin++ ? ('--', $_) : $_ } @ARGV;
 
-# Parse our options, trying to retain backwards compatibility with pod2man
-# but allowing short forms as well.  --lax is currently ignored.
+# Parse our options, trying to retain backwards compatibility with pod2man but
+# 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',
             'date|d=s', 'fixed=s', 'fixedbold=s', 'fixeditalic=s',
-            'fixedbolditalic=s', 'official|o', 'lax|l', 'help|h') or exit 1;
+            'fixedbolditalic=s', 'official|o', 'quotes|q=s', 'lax|l',
+            'help|h') or exit 1;
 pod2usage (0) if $options{help};
 
 # Official sets --center, but don't override things explicitly set.
@@ -71,9 +72,14 @@ if ($options{official} && !defined $options{center}) {
     $options{center} = 'Perl Programmers Reference Guide';
 }
 
-# Initialize and run the formatter.
+# Initialize and run the formatter, pulling a pair of input and output off at
+# a time.
 my $parser = Pod::Man->new (%options);
-$parser->parse_from_file (@ARGV);
+my @files;
+do {
+    @files = splice (@ARGV, 0, 2);
+    $parser->parse_from_file (@files);
+} while (@ARGV);
 
 __END__
 
@@ -86,8 +92,8 @@ pod2man - Convert POD data to formatted *roff input
 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>] [I<input>
-[I<output>]]
+[B<--fixedbolditalic>=I<font>] [B<--official>] [B<--lax>]
+[B<--quotes>=I<quotes>] [I<input> [I<output>] ...]
 
 pod2man B<--help>
 
@@ -100,7 +106,10 @@ terminal using nroff(1), normally via man(1), or printing using troff(1).
 I<input> is the file to read for POD source (the POD can be embedded in
 code).  If I<input> isn't given, it defaults to STDIN.  I<output>, if given,
 is the file to which to write the formatted output.  If I<output> isn't
-given, the formatted output is written to STDOUT.
+given, the formatted output is written to STDOUT.  Several POD files can be
+processed in the same B<pod2man> invocation (saving module load and compile
+times) by providing multiple pairs of I<input> and I<output> files on the
+command line.
 
 B<--section>, B<--release>, B<--center>, B<--date>, and B<--official> can be
 used to set the headers and footers to use; if not given, Pod::Man will
@@ -173,6 +182,19 @@ POD checking functionality is not yet implemented in Pod::Man.
 Set the default header to indicate that this page is part of the standard
 Perl release, if B<--center> is not also given.
 
+=item B<-q> I<quotes>, B<--quotes>=I<quotes>
+
+Sets the quote marks used to surround CE<lt>> text to I<quotes>.  If
+I<quotes> is a single character, it is used as both the left and right
+quote; if I<quotes> is two characters, the first character is used as the
+left quote and the second as the right quoted; and if I<quotes> is four
+characters, the first two are used as the left quote and the second two as
+the right quote.
+
+I<quotes> may also be set to the special value C<none>, in which case no
+quote marks are added around CE<lt>> text (but the font is still changed for
+troff output).
+
 =item B<-r>, B<--release>
 
 Set the centered footer.  By default, this is the version of Perl you run
@@ -401,6 +423,9 @@ 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
@@ -411,10 +436,28 @@ 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 COPYRIGHT AND LICENSE
+
+For copyright
+
+    Copyright YEAR(s) by YOUR NAME(s)
+
+(No, (C) is not needed.  No, "all rights reserved" is not needed.)
+
+For licensing the easiest way is to use the same licensing as Perl itself:
+
+    This library is free software; you may redistribute it and/or modify
+    it under the same terms as Perl itself.
+
+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
 
-Programs derived from other sources sometimes have this, or you might keep a
-modification log here.
+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.
 
 =back
 
@@ -425,10 +468,7 @@ of a C library.  Documentation of object-oriented libraries or modules may
 use CONSTRUCTORS and METHODS sections for detailed documentation of the
 parts of the library and save the DESCRIPTION section for an overview; other
 large modules may use FUNCTIONS for similar reasons.  Some people use
-OVERVIEW to summarize the description if it's quite long.  Sometimes there's
-an additional COPYRIGHT section at the bottom, for licensing terms.
-AVAILABILITY is sometimes added, giving the canonical download site for the
-software or a URL for updates.
+OVERVIEW to summarize the description if it's quite long.
 
 Section ordering varies, although NAME should I<always> be the first section
 (you'll break some man page systems otherwise), and NAME, SYNOPSIS,
@@ -459,11 +499,18 @@ your system.
 
 =head1 AUTHOR
 
-Russ Allbery E<lt>rra@stanford.eduE<gt>, based I<very> heavily on the
-original B<pod2man> by Larry Wall and Tom Christiansen.  Large portions of
-this documentation, particularly the sections on the anatomy of a proper man
+Russ Allbery <rra@stanford.edu>, based I<very> heavily on the original
+B<pod2man> by Larry Wall and Tom Christiansen.  Large portions of this
+documentation, particularly the sections on the anatomy of a proper man
 page, are taken from the B<pod2man> documentation by Tom.
 
+=head1 COPYRIGHT AND LICENSE
+
+Copyright 1999, 2000, 2001 by Russ Allbery <rra@stanford.edu>.
+
+This program is free software; you may redistribute it and/or modify it
+under the same terms as Perl itself.
+
 =cut
 !NO!SUBS!
 #'# (cperl-mode)