line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package CPAN::Digger::CLI; |
2
|
1
|
|
|
1
|
|
310349
|
use strict; |
|
1
|
|
|
|
|
10
|
|
|
1
|
|
|
|
|
32
|
|
3
|
1
|
|
|
1
|
|
6
|
use warnings FATAL => 'all'; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
55
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
our $VERSION = '1.03'; |
6
|
|
|
|
|
|
|
|
7
|
1
|
|
|
1
|
|
712
|
use Getopt::Long qw(GetOptions); |
|
1
|
|
|
|
|
11487
|
|
|
1
|
|
|
|
|
4
|
|
8
|
|
|
|
|
|
|
|
9
|
1
|
|
|
1
|
|
590
|
use CPAN::Digger; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
292
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub run { |
12
|
1
|
|
|
1
|
0
|
3092
|
my %args = ( |
13
|
|
|
|
|
|
|
report => undef, |
14
|
|
|
|
|
|
|
author => undef, |
15
|
|
|
|
|
|
|
github => undef, |
16
|
|
|
|
|
|
|
recent => undef, |
17
|
|
|
|
|
|
|
log => 'INFO', |
18
|
|
|
|
|
|
|
help => undef, |
19
|
|
|
|
|
|
|
sleep => 0, |
20
|
|
|
|
|
|
|
db => undef, |
21
|
|
|
|
|
|
|
version => undef, |
22
|
|
|
|
|
|
|
limit => undef, |
23
|
|
|
|
|
|
|
); |
24
|
|
|
|
|
|
|
|
25
|
1
|
50
|
|
|
|
7
|
GetOptions( |
26
|
|
|
|
|
|
|
\%args, |
27
|
|
|
|
|
|
|
'author=s', |
28
|
|
|
|
|
|
|
'db=s', |
29
|
|
|
|
|
|
|
'recent=i', |
30
|
|
|
|
|
|
|
'limit=i', |
31
|
|
|
|
|
|
|
'sleep=i', |
32
|
|
|
|
|
|
|
'github', |
33
|
|
|
|
|
|
|
'log=s', |
34
|
|
|
|
|
|
|
'report', |
35
|
|
|
|
|
|
|
'help', |
36
|
|
|
|
|
|
|
'version', |
37
|
|
|
|
|
|
|
) or usage(); |
38
|
1
|
50
|
|
|
|
1245
|
usage() if $args{help}; |
39
|
1
|
50
|
|
|
|
5
|
if ($args{version}) { |
40
|
0
|
|
|
|
|
0
|
print "CPAN::Digger VERSION $VERSION\n"; |
41
|
0
|
|
|
|
|
0
|
exit(); |
42
|
|
|
|
|
|
|
} |
43
|
1
|
50
|
25
|
|
|
9
|
usage() if not ($args{author} xor $args{recent}); |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
|
46
|
1
|
|
|
|
|
12
|
my $cd = CPAN::Digger->new(%args); |
47
|
1
|
|
|
|
|
6
|
$cd->collect(); |
48
|
|
|
|
|
|
|
} |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
sub usage { |
52
|
0
|
|
|
0
|
0
|
|
die qq{CPAN::Digger VERSION $VERSION |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
Usage: $0 |
55
|
|
|
|
|
|
|
Required exactly one of them: |
56
|
|
|
|
|
|
|
--recent N (Number of the most recent packages to check) |
57
|
|
|
|
|
|
|
--author PAUSEID |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
--report (Show text report at the end of processing.) |
60
|
|
|
|
|
|
|
--log LEVEL [ALL, TRACE, DEBUG, INFO, WARN, ERROR, FATAL, OFF] (default is INFO) |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
--github Fetch information from github |
63
|
|
|
|
|
|
|
--sleep SECONDS (Wait time between git clone operations, defaults to 0) |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
--db PATH (path to SQLite database file, if not supplied using in-memory database) |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
--version |
68
|
|
|
|
|
|
|
--help |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
Sample usage for authors: |
71
|
|
|
|
|
|
|
$0 --author SZABGAB --report --github --sleep 3 |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
Sample usage in general: |
74
|
|
|
|
|
|
|
$0 --recent 30 --report --github --sleep 3 |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
}; |
77
|
|
|
|
|
|
|
} |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
42; |
81
|
|
|
|
|
|
|
|