line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Shell::Command; |
2
|
|
|
|
|
|
|
BEGIN { |
3
|
2
|
|
|
2
|
|
50193
|
$Shell::Command::AUTHORITY = 'cpan:FLORA'; |
4
|
|
|
|
|
|
|
} |
5
|
|
|
|
|
|
|
BEGIN { |
6
|
2
|
|
|
2
|
|
143
|
$Shell::Command::VERSION = '0.06'; |
7
|
|
|
|
|
|
|
} |
8
|
|
|
|
|
|
|
# ABSTRACT: Cross-platform functions emulating common shell commands |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
# This must come first before ExtUtils::Command is loaded to ensure it |
11
|
|
|
|
|
|
|
# takes effect. |
12
|
|
|
|
|
|
|
BEGIN { |
13
|
|
|
|
|
|
|
*CORE::GLOBAL::exit = sub { |
14
|
4
|
100
|
|
4
|
|
1059
|
CORE::exit($_[0]) unless caller eq 'ExtUtils::Command'; |
15
|
|
|
|
|
|
|
|
16
|
3
|
|
100
|
|
|
13
|
my $exit = $_[0] || 0; |
17
|
3
|
|
|
|
|
17
|
die "exit: $exit\n"; |
18
|
2
|
|
|
2
|
|
56
|
}; |
19
|
|
|
|
|
|
|
} |
20
|
|
|
|
|
|
|
|
21
|
2
|
|
|
2
|
|
1942
|
use ExtUtils::Command (); |
|
2
|
|
|
|
|
20371
|
|
|
2
|
|
|
|
|
51
|
|
22
|
2
|
|
|
2
|
|
17
|
use Exporter; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
132
|
|
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
@ISA = qw(Exporter); |
25
|
|
|
|
|
|
|
@EXPORT = @ExtUtils::Command::EXPORT; |
26
|
|
|
|
|
|
|
@EXPORT_OK = @ExtUtils::Command::EXPORT_OK; |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
|
29
|
2
|
|
|
2
|
|
9
|
use strict; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
86
|
|
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
foreach my $func (@ExtUtils::Command::EXPORT, |
32
|
|
|
|
|
|
|
@ExtUtils::Command::EXPORT_OK) |
33
|
|
|
|
|
|
|
{ |
34
|
2
|
|
|
2
|
|
9
|
no strict 'refs'; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
366
|
|
35
|
|
|
|
|
|
|
*{$func} = sub { |
36
|
5
|
|
|
5
|
|
50
|
local @ARGV = @_; |
37
|
|
|
|
|
|
|
|
38
|
5
|
|
|
|
|
7
|
my $ret; |
39
|
5
|
|
|
|
|
8
|
eval { |
40
|
5
|
|
|
|
|
6
|
$ret = &{'ExtUtils::Command::'.$func}; |
|
5
|
|
|
|
|
31
|
|
41
|
|
|
|
|
|
|
}; |
42
|
5
|
100
|
|
|
|
363
|
if( $@ =~ /^exit: (\d+)\n$/ ) { |
|
|
50
|
|
|
|
|
|
43
|
3
|
|
|
|
|
8
|
$ret = !$1; |
44
|
|
|
|
|
|
|
} |
45
|
|
|
|
|
|
|
elsif( $@ ) { |
46
|
0
|
|
|
|
|
0
|
die $@; |
47
|
|
|
|
|
|
|
} |
48
|
|
|
|
|
|
|
else { |
49
|
2
|
50
|
33
|
|
|
19
|
$ret = 1 unless defined $ret and length $ret; |
50
|
|
|
|
|
|
|
} |
51
|
|
|
|
|
|
|
|
52
|
5
|
|
|
|
|
26
|
return $ret; |
53
|
|
|
|
|
|
|
}; |
54
|
|
|
|
|
|
|
} |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
1; |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
__END__ |