lib/Bio/BPWrapper.pm

filter: Statementstmt 83.3% 20 / 24 Branchbran 50.0% 3 / 6 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 85.7% 6 / 7 Podpod 0.0% 0 / 2 totaltotal 74.3% 29 / 39 CC 3 SCAR 6.1
CC
3
Cov
77%
common_opts
3.2
print_version
2.0
BEGIN
1.0
CRAP 1.8
« Build ↑ Summary bin/bioseq »
1 #!/usr/bin/env perl
2 # Copyright (c) 2016 by Weigang Qiu Lab
3  
4 package Bio::BPWrapper;
5  
6 45 our $VERSION = '1.10';
7 45 ▶use strict; use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
Subroutine BEGIN: called CC=1 SCAR=0.0
8 45 ▶use 5.010;
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 45 ▶use constant PROGRAM => 'Bio::BPWrapper';
Subroutine BEGIN: called CC=1 SCAR=0.0
11  
12 =pod
13  
14 =head2 Common Subroutines
15  
16 =head3 print_version $program_name
17  
18 Show program name and version and exit
19  
20 =cut
21  
22  
23 sub print_version($)
24 {
25 0 ▶ my $program = shift;
Subroutine print_version: not called CC=1 SCAR=6.9
Pod undocumented
26 0 say "${program}, version $Bio::BPWrapper::VERSION";
27 0 exit;
28 }
29  
30 45 ▶use Pod::Usage;
Subroutine BEGIN: called CC=1 SCAR=0.0
31  
32 =head3 common_opts $opts
33  
34 Handle some common options:
35  
36 =over 4
37  
38 =item C<--help>, C<-h>
39  
40 Show usage help
41  
42 =item C<--man>
43  
44 Show a manual page via L<Pod::Usage>
45  
46 =back
47  
48 =cut
49  
50 sub common_opts($)
51 {
52 45 ▶ my $opts = shift;
Subroutine common_opts: called CC=3 SCAR=11.7
Pod undocumented
53 45 ▶ pod2usage(1) if $opts->{"help"};
Branch: 1 branch
BranchTrueFalseTotal
if $opts->{"help"} 0 45 45
54 45 ▶ pod2usage(-exitstatus => 0, -verbose => 2) if $opts->{"man"};
Branch: 1 branch
BranchTrueFalseTotal
if $opts->{"man"} 0 45 45
55 }
56  
57  
58 45 ▶unless (caller) {
Branch: 1 branch
BranchTrueFalseTotal
unless (caller) 0 45 45
59 0 print "Pssst... this is a module. Invoke via bioaln, bioseq, biopop, or biotree.\n";
60 }
61 45 1;
« Build ↑ Summary bin/bioseq »