| 1 | #!/usr/bin/env perl | ||||||||||
| 2 | # Copyright (c) 2016 by Weigang Qiu Lab | ||||||||||
| 3 | |||||||||||
| 4 | package Bio::BPWrapper; | ||||||||||
| 5 | |||||||||||
| 6 | 45 | our $VERSION = '1.11'; | |||||||||
| 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
| |||||||||||
| 54 | 45 | ▶ | pod2usage(-exitstatus => 0, -verbose => 2) if $opts->{"man"}; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 55 | } | ||||||||||
| 56 | |||||||||||
| 57 | |||||||||||
| 58 | 45 | ▶ | unless (caller) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 59 | 0 | print "Pssst... this is a module. Invoke via bioaln, bioseq, biopop, or biotree.\n"; | |||||||||
| 60 | } | ||||||||||
| 61 | 45 | 1; | |||||||||