From: Ilya Zakharevich Date: Wed, 4 Jun 2003 00:45:23 +0000 (-0700) Subject: Re: [PATCH 5.8.1 @19053] Getopt::Std X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=669ecdbcc9859cccd0b304b919aa0725f0097a2a;p=p5sagit%2Fp5-mst-13.2.git Re: [PATCH 5.8.1 @19053] Getopt::Std Message-ID: <20030604074523.GA7148@math.berkeley.edu> p4raw-id: //depot/perl@21245 --- diff --git a/lib/Getopt/Std.pm b/lib/Getopt/Std.pm index 99e9269..1783adb 100644 --- a/lib/Getopt/Std.pm +++ b/lib/Getopt/Std.pm @@ -55,6 +55,9 @@ the output file handle, the name of option-processing package, its version, and the switches string. If the subroutines are not defined, an attempt is made to generate intelligent messages; for best results, define $main::VERSION. +If embedded documentation (in pod format, see L) is detected +in the script, C<--help> will also show how to access the documentation. + Note that due to excessive paranoia, if $Getopt::Std::STANDARD_HELP_VERSION isn't true (the default is false), then the messages are printed on STDERR, and the processing continues after the messages are printed. This being @@ -186,12 +189,27 @@ sub help_mess ($;$) { } my ($scr) = ($0 =~ m,([^/\\]+)$,); print $h <) { + $has_pod = 1, last if /^=(pod|head1)/; + } + } + print $h <