File Coverage

blib/lib/App/Cmd/Command/version.pm
Criterion Covered Total %
statement 15 15 100.0
branch n/a
condition n/a
subroutine 8 8 100.0
pod 2 4 50.0
total 25 27 92.5


line stmt bran cond sub pod time code
1 13     13   7589 use strict;
  13         39  
  13         399  
2 13     13   72 use warnings;
  13         38  
  13         490  
3              
4             package App::Cmd::Command::version 0.336;
5              
6 13     13   78 use App::Cmd::Command;
  13         44  
  13         407  
7 13     13   2413 BEGIN { our @ISA = 'App::Cmd::Command'; }
8              
9             # ABSTRACT: display an app's version
10              
11             #pod =head1 DESCRIPTION
12             #pod
13             #pod This command will display the program name, its base class
14             #pod with version number, and the full program name.
15             #pod
16             #pod =cut
17              
18 34     34 1 101 sub command_names { qw/version --version/ }
19              
20             sub version_for_display {
21 2     2 0 4 $_[0]->version_package->VERSION
22             }
23              
24             sub version_package {
25 4     4 0 25 ref($_[0]->app)
26             }
27              
28             sub execute {
29 2     2 1 17 my ($self, $opts, $args) = @_;
30              
31 2         14 printf "%s (%s) version %s (%s)\n",
32             $self->app->arg0, $self->version_package,
33             $self->version_for_display, $self->app->full_arg0;
34             }
35              
36             1;
37              
38             __END__