2 eval 'exec perl -S $0 "$@"'
5 #############################################################################
6 # podselect -- command to invoke the podselect function in Pod::Select
8 # Copyright (c) 1996-2000 by Bradford Appleton. All rights reserved.
9 # This file is part of "PodParser". PodParser is free software;
10 # you can redistribute it and/or modify it under the same terms
12 #############################################################################
19 podselect - print selected sections of pod documentation on standard output
23 B<podselect> [B<-help>] [B<-man>] [B<-section>S< >I<section-spec>]
26 =head1 OPTIONS AND ARGUMENTS
32 Print a brief help message and exit.
36 Print the manual page and exit.
38 =item B<-section>S< >I<section-spec>
40 Specify a section to include in the output.
41 See L<Pod::Parser/"SECTION SPECIFICATIONS">
42 for the format to use for I<section-spec>.
43 This option may be given multiple times on the command line.
47 The pathname of a file from which to select sections of pod
48 documentation (defaults to standard input).
54 B<podselect> will read the given input files looking for pod
55 documentation and will print out (in raw pod format) all sections that
56 match one ore more of the given section specifications. If no section
57 specifications are given than all pod sections encountered are output.
59 B<podselect> invokes the B<podselect()> function exported by B<Pod::Select>
60 Please see L<Pod::Select/podselect()> for more details.
64 L<Pod::Parser> and L<Pod::Select>
68 Please report bugs using L<http://rt.cpan.org>.
70 Brad Appleton E<lt>bradapp@enteract.comE<gt>
72 Based on code for B<Pod::Text::pod2text(1)> written by
73 Tom Christiansen E<lt>tchrist@mox.perl.comE<gt>
89 GetOptions
(\
%options, "help", "man", "sections|select=s@") || pod2usage
(2);
90 pod2usage
(1) if ($options{help
});
91 pod2usage
(-verbose
=> 2) if ($options{man
});
93 ## Dont default to STDIN if connected to a terminal
94 pod2usage
(2) if ((@ARGV == 0) && (-t STDIN
));
96 ## Invoke podselect().
97 if (@
{ $options{"sections"} } > 0) {
98 podselect
({ -sections
=> $options{"sections"} }, @ARGV);