App/lcpan/Cmd/mentions_for_mod.pm

filter: Statementstmt 79.3% 23 / 29 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 80.0% 4 / 5 Podpod 100% 1 / 1 totaltotal 80.0% 28 / 35 CC 1 SCAR 1.8
CC
1
Cov
79%
handle_cmd
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.2
« App/lcpan/Cmd/delete_old_data.pm ↑ Summary App/lcpan/Cmd/mentions_for_script.pm »
1 package App::lcpan::Cmd::mentions_for_mod;
2  
3 2 ▶use 5.010;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 2 ▶use Log::ger;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 2 require App::lcpan;
9 2 require App::lcpan::Cmd::mentions;
10  
11 2 our $AUTHORITY = 'cpan:PERLANCAR'; # AUTHORITY
12 2 our $DATE = '2023-09-26'; # DATE
13 2 our $DIST = 'App-lcpan'; # DIST
14 2 our $VERSION = '1.074'; # VERSION
15  
16 2 our %SPEC;
17  
18 2 my $mentions_args = $App::lcpan::Cmd::mentions::SPEC{handle_cmd}{args};
19  
20 $SPEC{'handle_cmd'} = {
21 v => 1.1,
22 summary => 'List POD mentions for module(s)',
23 description => <<'_',
24  
25 This subcommand is a shortcut for:
26  
27 % lcpan mentions --type known-module --mentioned-module <module1> [module2] ...
28  
29 This searches PODs that mention either `module1`, `module2`, and so on. To
30 search for PODs that mention *all* of the modules, see the
31 `mentions-for-all-mods` subcommand.
32  
33 _
34 args => {
35 %App::lcpan::common_args,
36 %App::lcpan::mods_args,
37 36 (map {$_ => $mentions_args->{$_}}
38 2 grep {!/\A(type|mentioned_modules|mentioned_scripts)\z/}
39 keys %$mentions_args),
40 },
41 };
42 0 ▶sub handle_cmd {
Subroutine handle_cmd: not called CC=1 SCAR=6.9
Pod documented
43 0 my %args = @_;
44  
45 0 my %mentions_args = %args;
46  
47 0 delete $mentions_args{modules};
48 0 $mentions_args{mentioned_modules} = $args{modules};
49  
50 0 $mentions_args{type} = 'known-module';
51  
52 0 App::lcpan::Cmd::mentions::handle_cmd(%mentions_args);
53 }
54  
55 2 1;
56 # ABSTRACT: List POD mentions for module(s)
57  
58 __END__
« App/lcpan/Cmd/delete_old_data.pm ↑ Summary App/lcpan/Cmd/mentions_for_script.pm »