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
|
|
4
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
17
|
|
4
|
1
|
|
|
1
|
|
3
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
20
|
|
5
|
1
|
|
|
1
|
|
3
|
use Carp; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
59
|
|
6
|
1
|
|
|
1
|
|
6
|
use Path::Tiny; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
170
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
our $VERSION = "0.09"; |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub set_value { |
11
|
5
|
|
|
5
|
1
|
8
|
my $self = shift; |
12
|
5
|
|
|
|
|
8
|
my ($value) = @_; |
13
|
|
|
|
|
|
|
|
14
|
5
|
|
|
|
|
14
|
my $p = path($value); |
15
|
5
|
100
|
|
|
|
145
|
if ($p->is_file) { |
|
|
100
|
|
|
|
|
|
16
|
1
|
|
|
|
|
97
|
printf STDERR "error: '%s' is a file, try --help\n", $value; |
17
|
1
|
|
|
|
|
9
|
return undef, 1; |
18
|
|
|
|
|
|
|
} elsif ($p->is_dir) { |
19
|
|
|
|
|
|
|
# ok |
20
|
|
|
|
|
|
|
} else { |
21
|
1
|
|
|
|
|
60
|
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__ |