ensembl-hive  2.8.1
ensembldoxygenfilter.pl
Go to the documentation of this file.
1 #!/usr/bin/env perl
2 # See the NOTICE file distributed with this work for additional information
3 # regarding copyright ownership.
4 #
5 # Licensed under the Apache License, Version 2.0 (the "License");
6 # you may not use this file except in compliance with the License.
7 # You may obtain a copy of the License at
8 #
9 # http://www.apache.org/licenses/LICENSE-2.0
10 #
11 # Unless required by applicable law or agreed to in writing, software
12 # distributed under the License is distributed on an "AS IS" BASIS,
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
16 
17 
18 use warnings;
19 use strict;
20 
21 sub BEGIN {
22  use FindBin qw/$Bin/;
23  use lib $Bin;
25 }
26 
27 use Getopt::Long;
28 use Pod::Usage;
29 my $opts = {
30  help => 0,
31  verbose => 0
32 };
33 GetOptions( $opts, qw/verbose help/) or pod2usage(-msg => 'Error during command line parsing', -exitlevel => 1, -verbose => 1);
34 pod2usage(-exitlevel => 0, -verbose => 2) if $opts->{help};
35 my $file = $ARGV[0];
36 pod2usage(-msg => 'No file given', -exitlevel => 1, -verbose => 1) if ! $file;
37 pod2usage(-msg => 'File '.$file.' does not exist', -exitlevel => 1, -verbose => 1) if ! -f $file;
38 my ($ext) = lc($ARGV[0]) =~ /\.([a-z]+)$/;
39 
40 if( $ext eq 'pl' || $ext eq 'pm' || $ext eq 'perl' ) {
41  print STDERR "Working with a Perl file\n" if $opts->{verbose};
42  my $filter = EnsEMBL::PerlFilter->new(\*STDOUT);
43  $filter->filter($file);
44 }
45 else {
46  print STDERR "Passing file through\n" if $opts->{verbose};
47  print <>;
48 }
49 
50 exit 0;
51 __END__
52 =pod
53 
54 =head1 NAME
55 
56 ensembldoxygenfilter.pl
57 
58 =head1 SYNOPSIS
59 
60  ./ensembldoxygenfilter.pl -v modules/Bio/EnsEMBL/Registry.pm
61 
62  ./ensembldoxygenfilter.pl -help
63 
64 =head1 DESCRIPTION
65 
66 Generate Doxygen compatible filtered files from Ensembl POD. Bring this onto
67 your PATH and edit your Doxygen configuration file and specify
68 
69 INPUT_FILTER=ensembldoxygenfilter.pl
70 
71 The code has been flagged as executable in CVS and so should be self
72 executing once you check it out.
73 
74 =head1 OPTIONS
75 
76 =over 8
77 
78 =item B<--verbose>
79 
80 Prints messages to STDERR
81 
82 =item B<--help>
83 
84 Prints this message
85 
86 =back
EnsEMBL
Definition: Filter.pm:1
BEGIN
public BEGIN()
EnsEMBL::PerlFilter
Definition: PerlFilter.pm:18
EnsEMBL::PerlFilter::filter
public filter()
Bio
Definition: AltAlleleGroup.pm:4