line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
########################################### |
2
|
|
|
|
|
|
|
# File::Comments::Plugin::Shell |
3
|
|
|
|
|
|
|
# 2005, Mike Schilli |
4
|
|
|
|
|
|
|
########################################### |
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
########################################### |
7
|
|
|
|
|
|
|
package File::Comments::Plugin::Shell; |
8
|
|
|
|
|
|
|
########################################### |
9
|
|
|
|
|
|
|
|
10
|
9
|
|
|
9
|
|
11854
|
use strict; |
|
9
|
|
|
|
|
20
|
|
|
9
|
|
|
|
|
300
|
|
11
|
9
|
|
|
9
|
|
52
|
use warnings; |
|
9
|
|
|
|
|
20
|
|
|
9
|
|
|
|
|
222
|
|
12
|
9
|
|
|
9
|
|
43
|
use File::Comments::Plugin; |
|
9
|
|
|
|
|
16
|
|
|
9
|
|
|
|
|
221
|
|
13
|
9
|
|
|
9
|
|
44
|
use Log::Log4perl qw(:easy); |
|
9
|
|
|
|
|
18
|
|
|
9
|
|
|
|
|
53
|
|
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
our $VERSION = "0.01"; |
16
|
|
|
|
|
|
|
our @ISA = qw(File::Comments::Plugin); |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
########################################### |
19
|
|
|
|
|
|
|
sub applicable { |
20
|
|
|
|
|
|
|
########################################### |
21
|
2
|
|
|
2
|
0
|
5
|
my($self, $target, $cold_call) = @_; |
22
|
|
|
|
|
|
|
|
23
|
2
|
50
|
|
|
|
6
|
return 1 unless $cold_call; |
24
|
|
|
|
|
|
|
|
25
|
2
|
50
|
|
|
|
9
|
return 1 if $target->{content} =~ m{^#!.*/(sh|bash|tcsh|csh|zsh)\b}; |
26
|
|
|
|
|
|
|
|
27
|
2
|
|
|
|
|
6
|
return 0; |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
########################################### |
31
|
|
|
|
|
|
|
sub init { |
32
|
|
|
|
|
|
|
########################################### |
33
|
11
|
|
|
11
|
0
|
26
|
my($self) = @_; |
34
|
|
|
|
|
|
|
|
35
|
11
|
|
|
|
|
73
|
$self->register_suffix(".sh"); |
36
|
11
|
|
|
|
|
40
|
$self->register_suffix(".csh"); |
37
|
11
|
|
|
|
|
42
|
$self->register_suffix(".tcsh"); |
38
|
11
|
|
|
|
|
39
|
$self->register_suffix(".bash"); |
39
|
11
|
|
|
|
|
38
|
$self->register_suffix(".zsh"); |
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
########################################### |
43
|
|
|
|
|
|
|
sub type { |
44
|
|
|
|
|
|
|
########################################### |
45
|
0
|
|
|
0
|
0
|
|
my($self, $target) = @_; |
46
|
|
|
|
|
|
|
|
47
|
0
|
|
|
|
|
|
return "shell"; |
48
|
|
|
|
|
|
|
} |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
########################################### |
51
|
|
|
|
|
|
|
sub comments { |
52
|
|
|
|
|
|
|
########################################### |
53
|
0
|
|
|
0
|
0
|
|
my($self, $target) = @_; |
54
|
|
|
|
|
|
|
|
55
|
0
|
|
|
|
|
|
return File::Comments::Plugin::Makefile->extract_hashed_comments($target); |
56
|
|
|
|
|
|
|
} |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
########################################### |
59
|
|
|
|
|
|
|
sub stripped { |
60
|
|
|
|
|
|
|
########################################### |
61
|
0
|
|
|
0
|
0
|
|
my($self, $target) = @_; |
62
|
|
|
|
|
|
|
|
63
|
0
|
|
|
|
|
|
return File::Comments::Plugin::Makefile->strip_hashed_comments($target); |
64
|
|
|
|
|
|
|
} |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
1; |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
__END__ |