line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Getopt::Kingpin::Type::ExistingDir; |
2
|
1
|
|
|
1
|
|
17
|
use 5.008001; |
|
1
|
|
|
|
|
3
|
|
3
|
1
|
|
|
1
|
|
5
|
use strict; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
18
|
|
4
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
22
|
|
5
|
1
|
|
|
1
|
|
4
|
use Carp; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
50
|
|
6
|
1
|
|
|
1
|
|
4
|
use Path::Tiny; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
172
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
our $VERSION = "0.10"; |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub set_value { |
11
|
5
|
|
|
5
|
1
|
17
|
my $self = shift; |
12
|
5
|
|
|
|
|
9
|
my ($value) = @_; |
13
|
|
|
|
|
|
|
|
14
|
5
|
|
|
|
|
11
|
my $p = path($value); |
15
|
5
|
100
|
|
|
|
158
|
if ($p->is_file) { |
|
|
100
|
|
|
|
|
|
16
|
1
|
|
|
|
|
86
|
printf STDERR "error: '%s' is a file, try --help\n", $value; |
17
|
1
|
|
|
|
|
8
|
return undef, 1; |
18
|
|
|
|
|
|
|
} elsif ($p->is_dir) { |
19
|
|
|
|
|
|
|
# ok |
20
|
|
|
|
|
|
|
} else { |
21
|
1
|
|
|
|
|
59
|
printf STDERR "error: path '%s' does not exist, try --help\n", $value; |
22
|
1
|
|
|
|
|
8
|
return undef, 1; |
23
|
|
|
|
|
|
|
} |
24
|
3
|
|
|
|
|
131
|
return $p; |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
1; |
28
|
|
|
|
|
|
|
__END__ |