Setup/Project/CLI.pm untested

filter: Statementstmt 0.0% 0 / 31 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 10 Podpod 0.0% 0 / 4 totaltotal 0.0% 0 / 45 CC 1 SCAR 6.9
CC
1
Cov
0%
new
2.0
argv
2.0
maker
2.0
CRAP 2.0
1 package Setup::Project::CLI;
2 use strict;
3 use warnings;
4 use parent 'Exporter';
5  
6 our @EXPORT = qw/
7 usage
8 /;
9  
10 use Class::Accessor::Lite (
11 rw => [qw/version/]
12 );
13  
14 use Getopt::Compact::WithCmd;
15 use Setup::Project;
16  
17 sub new {
18 my $class = shift;
19 my $go = Getopt::Compact::WithCmd->new(
20 global_struct => {
21 'distdir' => {
22 alias => 'd',
23 type => 'Str',
24 desc => 'dist dir',
25 opts => {
26 required => 1,
27 },
28 },
29 },
30 );
31  
32 bless {
33 go => $go,
34 argv => \@ARGV,
35 }, $class;
36 }
37  
38 sub argv {
39 my $self = shift;
40 return $self->{argv};
41 }
42  
43 sub maker {
44 my ($self, %args) = @_;
45  
46 my $maker = Setup::Project->new(
47 tmpl_dir => $args{tmpl_dir},
48 write_dir => $self->{go}->opts->{distdir},
49 );
50 }
51  
52 sub usage {
53 my $msg = shift;
54 print("usage: $0 -d /tmp/distdir $msg \n");
55 exit -1;
56 }
57  
58 1;