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