File Coverage

File:lib/Code/Statistics/App.pm
Coverage:100.0%

linestmtbrancondsubpodtimecode
1
2
2
2
0
0
0
use strict;
2
2
2
2
0
0
0
use warnings;
3
4package Code::Statistics::App;
5
6# ABSTRACT: handles global command configuration and cstat instantiation
7
8
2
2
2
0
0
0
use App::Cmd::Setup -app;
9
10
2
2
2
0
0
0
use Code::Statistics;
11
12sub global_opt_spec {
13
12
0
    my @opts = (
14        [ 'global_conf_file|g=s' => 'path to the global config file' ],
15        [ 'conf_file|c=s' => 'path to the local config file' ],
16        [ 'profile|p=s' => 'a configuration profile' ],
17    );
18
12
0
    return @opts;
19}
20
21 - 23
=head2 cstat
    Creates a Code::Statistics object with the given commandline args.
=cut
24
25sub cstat {
26
6
0
    my ( $self, %command_args ) = @_;
27
28
6
6
0
0
    my %args = ( %{ $self->global_options }, command => ( $self->get_command( @ARGV ) )[0], );
29
30
6
0
    return Code::Statistics->new( %args, args => \%command_args );
31}
32
331;