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   8381 use strict;
  13         26  
  13         473  
2 13     13   73 use warnings;
  13         39  
  13         907  
3              
4             package App::Cmd::Command::version 0.340;
5              
6 13     13   77 use App::Cmd::Command;
  13         30  
  13         578  
7 13     13   2374 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 36     36 1 99 sub command_names { qw/version --version/ }
19              
20             sub version_for_display {
21 2     2 0 5 $_[0]->version_package->VERSION
22             }
23              
24             sub version_package {
25 4     4 0 11 ref($_[0]->app)
26             }
27              
28             sub execute {
29 2     2 1 7 my ($self, $opts, $args) = @_;
30              
31 2         10 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__