| 1 | package CPAN::Digger::CLI; | |||||||||||||||||||||||||||||||||
| 2 | 5 | ▶ | use strict; | |||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| ||||||||||||||||||||||||||||||||||
| 3 | 5 | ▶ | use warnings FATAL => 'all'; | |||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| ||||||||||||||||||||||||||||||||||
| 4 | ||||||||||||||||||||||||||||||||||
| 5 | 5 | our $VERSION = '1.03'; | ||||||||||||||||||||||||||||||||
| 6 | ||||||||||||||||||||||||||||||||||
| 7 | 5 | ▶ | use Getopt::Long qw(GetOptions); | |||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| ||||||||||||||||||||||||||||||||||
| 8 | ||||||||||||||||||||||||||||||||||
| 9 | 5 | ▶ | use CPAN::Digger; | |||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| ||||||||||||||||||||||||||||||||||
| 10 | ||||||||||||||||||||||||||||||||||
| 11 | sub run { | |||||||||||||||||||||||||||||||||
| 12 | 5 | ▶ | my %args = ( | |||||||||||||||||||||||||||||||
|
Subroutine
run: called CC=6 SCAR=20.8
Pod
undocumented
| ||||||||||||||||||||||||||||||||||
| 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 | 5 | ▶ | GetOptions( | |||||||||||||||||||||||||||||||
|
Branch: 1 branch
| ||||||||||||||||||||||||||||||||||
| 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 | 5 | ▶ | usage() if $args{help}; | |||||||||||||||||||||||||||||||
|
Branch: 1 branch
| ||||||||||||||||||||||||||||||||||
| 39 | 5 | ▶ | if ($args{version}) { | |||||||||||||||||||||||||||||||
|
Branch: 1 branch
| ||||||||||||||||||||||||||||||||||
| 40 | 0 | print "CPAN::Digger VERSION $VERSION\n"; | ||||||||||||||||||||||||||||||||
| 41 | 0 | exit(); | ||||||||||||||||||||||||||||||||
| 42 | } | |||||||||||||||||||||||||||||||||
| 43 | 5 | ▶ | usage() if not ($args{author} xor $args{recent}); | |||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition50%2/4
$args{"author"} xor $args{"recent"}
MC/DC0%0/2
$args{"author"} xor $args{"recent"}
$args{"author"}
$args{"recent"}
Truth table50%2/4
A xor B
A= $args{"author"}B= $args{"recent"}
| ||||||||||||||||||||||||||||||||||
| 44 | ||||||||||||||||||||||||||||||||||
| 45 | ||||||||||||||||||||||||||||||||||
| 46 | 5 | my $cd = CPAN::Digger->new(%args); | ||||||||||||||||||||||||||||||||
| 47 | 5 | $cd->collect(); | ||||||||||||||||||||||||||||||||
| 48 | } | |||||||||||||||||||||||||||||||||
| 49 | ||||||||||||||||||||||||||||||||||
| 50 | ||||||||||||||||||||||||||||||||||
| 51 | sub usage { | |||||||||||||||||||||||||||||||||
| 52 | 0 | ▶ | die qq{CPAN::Digger VERSION $VERSION | |||||||||||||||||||||||||||||||
|
Subroutine
usage: not called CC=1 SCAR=6.9
Pod
undocumented
| ||||||||||||||||||||||||||||||||||
| 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 | 5 | 42; | ||||||||||||||||||||||||||||||||
| 81 | ||||||||||||||||||||||||||||||||||