From 669ecdbcc9859cccd0b304b919aa0725f0097a2a Mon Sep 17 00:00:00 2001 From: Ilya Zakharevich Date: Tue, 3 Jun 2003 17:45:23 -0700 Subject: [PATCH] Re: [PATCH 5.8.1 @19053] Getopt::Std Message-ID: <20030604074523.GA7148@math.berkeley.edu> p4raw-id: //depot/perl@21245 --- lib/Getopt/Std.pm | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) 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 <