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