Minor doc patch: handy.h
[p5sagit/p5-mst-13.2.git] / pod / pod2man.PL
index 68d0c42..bf35cff 100644 (file)
@@ -36,14 +36,12 @@ $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 $
 #
-# Copyright 1999 by Russ Allbery <rra@stanford.edu>
+# Copyright 1999, 2000 by Russ Allbery <rra@stanford.edu>
 #
 # This program is free software; you can redistribute it and/or modify it
 # under the same terms as Perl itself.
-#
-# The driver script for Pod::Man.  This script is expected to eventually
-# replace pod2man in the standard Perl distribution.
 
 require 5.004;
 
@@ -52,12 +50,17 @@ use Pod::Man ();
 use Pod::Usage qw(pod2usage);
 
 use strict;
-use vars;
+
+# 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).
+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.
 my %options;
-Getopt::Long::config ('bundling');
+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;
@@ -69,7 +72,7 @@ if ($options{official} && !defined $options{center}) {
 }
 
 # Initialize and run the formatter.
-my $parser = Pod::Man->new (\%options);
+my $parser = Pod::Man->new (%options);
 $parser->parse_from_file (@ARGV);
 
 __END__
@@ -80,13 +83,13 @@ pod2man - Convert POD data to formatted *roff input
 
 =head1 SYNOPSIS
 
-pod2txt [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>] [I<input>
 [I<output>]]
 
-pod2txt B<--help>
+pod2man B<--help>
 
 =head1 DESCRIPTION
 
@@ -320,11 +323,11 @@ functions.
 
 =item ERRORS
 
-Exceptions, error return codes, exit stati, and errno settings.  Typically
-used for function documentation; program documentation uses DIAGNOSTICS
-instead.  The general rule of thumb is that errors printed to STDOUT or
-STDERR and intended for the end user are documented in DIAGNOSTICS while
-errors passed internal to the calling program and intended for other
+Exceptions, error return codes, exit statuses, and errno settings.
+Typically used for function documentation; program documentation uses
+DIAGNOSTICS instead.  The general rule of thumb is that errors printed to
+STDOUT or STDERR and intended for the end user are documented in DIAGNOSTICS
+while errors passed internal to the calling program and intended for other
 programmers are documented in ERRORS.  When documenting a function that sets
 errno, a full list of the possible errno values should be given here.
 
@@ -463,6 +466,7 @@ page, are taken from the B<pod2man> documentation by Tom.
 
 =cut
 !NO!SUBS!
+#'# (cperl-mode)
 
 close OUT or die "Can't close $file: $!";
 chmod 0755, $file or die "Can't reset permissions for $file: $!\n";