source: for-distributions/trunk/bin/windows/perl/bin/podselect.bat@ 14489

Last change on this file since 14489 was 14489, checked in by oranfry, 17 years ago

upgrading to perl 5.8

File size: 2.9 KB
Line 
1@rem = '--*-Perl-*--
2@echo off
3if "%OS%" == "Windows_NT" goto WinNT
4perl -x -S "%0" %1 %2 %3 %4 %5 %6 %7 %8 %9
5goto endofperl
6:WinNT
7perl -x -S %0 %*
8if NOT "%COMSPEC%" == "%SystemRoot%\system32\cmd.exe" goto endofperl
9if %errorlevel% == 9009 echo You do not have Perl in your PATH.
10if errorlevel 1 goto script_failed_so_exit_with_non_zero_val 2>nul
11goto endofperl
12@rem ';
13#!perl
14#line 15
15 eval 'exec perl -S $0 "$@"'
16 if 0;
17
18#############################################################################
19# podselect -- command to invoke the podselect function in Pod::Select
20#
21# Copyright (c) 1996-2000 by Bradford Appleton. All rights reserved.
22# This file is part of "PodParser". PodParser is free software;
23# you can redistribute it and/or modify it under the same terms
24# as Perl itself.
25#############################################################################
26
27use strict;
28use diagnostics;
29
30=head1 NAME
31
32podselect - print selected sections of pod documentation on standard output
33
34=head1 SYNOPSIS
35
36B<podselect> [B<-help>] [B<-man>] [B<-section>S< >I<section-spec>]
37[I<file>S< >...]
38
39=head1 OPTIONS AND ARGUMENTS
40
41=over 8
42
43=item B<-help>
44
45Print a brief help message and exit.
46
47=item B<-man>
48
49Print the manual page and exit.
50
51=item B<-section>S< >I<section-spec>
52
53Specify a section to include in the output.
54See L<Pod::Parser/"SECTION SPECIFICATIONS">
55for the format to use for I<section-spec>.
56This option may be given multiple times on the command line.
57
58=item I<file>
59
60The pathname of a file from which to select sections of pod
61documentation (defaults to standard input).
62
63=back
64
65=head1 DESCRIPTION
66
67B<podselect> will read the given input files looking for pod
68documentation and will print out (in raw pod format) all sections that
69match one ore more of the given section specifications. If no section
70specifications are given than all pod sections encountered are output.
71
72B<podselect> invokes the B<podselect()> function exported by B<Pod::Select>
73Please see L<Pod::Select/podselect()> for more details.
74
75=head1 SEE ALSO
76
77L<Pod::Parser> and L<Pod::Select>
78
79=head1 AUTHOR
80
81Please report bugs using L<http://rt.cpan.org>.
82
83Brad Appleton E<lt>[email protected]<gt>
84
85Based on code for B<Pod::Text::pod2text(1)> written by
86Tom Christiansen E<lt>[email protected]<gt>
87
88=cut
89
90use Pod::Select;
91use Pod::Usage;
92use Getopt::Long;
93
94## Define options
95my %options = (
96 "help" => 0,
97 "man" => 0,
98 "sections" => [],
99);
100
101## Parse options
102GetOptions(\%options, "help", "man", "sections|select=s@") || pod2usage(2);
103pod2usage(1) if ($options{help});
104pod2usage(-verbose => 2) if ($options{man});
105
106## Dont default to STDIN if connected to a terminal
107pod2usage(2) if ((@ARGV == 0) && (-t STDIN));
108
109## Invoke podselect().
110if (@{ $options{"sections"} } > 0) {
111 podselect({ -sections => $options{"sections"} }, @ARGV);
112}
113else {
114 podselect(@ARGV);
115}
116
117
118
119__END__
120:endofperl
Note: See TracBrowser for help on using the repository browser.