| 1 | package AnyPAN::CLI::FileStorage; | ||||||||||
| 2 | 1 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 3 | 1 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | |||||||||||
| 5 | 1 | ▶ | use parent qw/AnyPAN::CLI/; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | |||||||||||
| 7 | 1 | ▶ | use Class::Accessor::Lite ro => [qw/output_dir/]; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 8 | |||||||||||
| 9 | 1 | ▶ | use Pod::Usage qw/pod2usage/; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 10 | 1 | ▶ | use AnyPAN::Storage::Directory; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 11 | |||||||||||
| 12 | 0 | ▶ | sub create_option_specs { | ||||||||
|
Subroutine
create_option_specs: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 13 | 0 | my $class = shift; | |||||||||
| 14 | 0 | my @specs = $class->SUPER::create_option_specs(); | |||||||||
| 15 | return ( | ||||||||||
| 16 | 0 | @specs, | |||||||||
| 17 | 'output-dir|o=s', | ||||||||||
| 18 | ); | ||||||||||
| 19 | } | ||||||||||
| 20 | |||||||||||
| 21 | 0 | ▶ | sub convert_options { | ||||||||
|
Subroutine
convert_options: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||
| 22 | 0 | my ($class, $opts, $argv) = @_; | |||||||||
| 23 | |||||||||||
| 24 | # required option | ||||||||||
| 25 | 0 | ▶ | pod2usage(1) unless $opts->{'output-dir'}; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 26 | |||||||||||
| 27 | 0 | my %args = $class->SUPER::convert_options($opts, $argv); | |||||||||
| 28 | 0 | $args{output_dir} = $opts->{'output-dir'}; | |||||||||
| 29 | 0 | return %args; | |||||||||
| 30 | } | ||||||||||
| 31 | |||||||||||
| 32 | 0 | ▶ | sub create_storage { | ||||||||
|
Subroutine
create_storage: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 33 | 0 | my $self = shift; | |||||||||
| 34 | 0 | return AnyPAN::Storage::Directory->new( | |||||||||
| 35 | path => $self->output_dir, | ||||||||||
| 36 | ); | ||||||||||
| 37 | } | ||||||||||
| 38 | |||||||||||
| 39 | 1 | 1; | |||||||||
| 40 | __END__ | ||||||||||