| 1 | package App::lcpan::Cmd::author_rdeps; | ||||||||||
| 2 | |||||||||||
| 3 | 1 | ▶ | use 5.010; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 1 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | 1 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | |||||||||||
| 7 | 1 | require App::lcpan; | |||||||||
| 8 | 1 | ▶ | use Hash::Subset 'hash_subset'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 9 | |||||||||||
| 10 | 1 | our $AUTHORITY = 'cpan:PERLANCAR'; # AUTHORITY | |||||||||
| 11 | 1 | our $DATE = '2023-09-26'; # DATE | |||||||||
| 12 | 1 | our $DIST = 'App-lcpan'; # DIST | |||||||||
| 13 | 1 | our $VERSION = '1.074'; # VERSION | |||||||||
| 14 | |||||||||||
| 15 | 1 | our %SPEC; | |||||||||
| 16 | |||||||||||
| 17 | 1 | $SPEC{'handle_cmd'} = { | |||||||||
| 18 | v => 1.1, | ||||||||||
| 19 | summary => "Find distributions that use one of author's modules", | ||||||||||
| 20 | args => { | ||||||||||
| 21 | %App::lcpan::common_args, | ||||||||||
| 22 | %App::lcpan::author_args, | ||||||||||
| 23 | %App::lcpan::rdeps_rel_args, | ||||||||||
| 24 | %App::lcpan::rdeps_phase_args, | ||||||||||
| 25 | user_authors => { | ||||||||||
| 26 | 'x.name.is_plural' => 1, | ||||||||||
| 27 | 'x.name.singular' => 'user_author', | ||||||||||
| 28 | schema => ['array*', of=>'str*'], | ||||||||||
| 29 | element_completion => \&App::lcpan::_complete_cpanid, | ||||||||||
| 30 | }, | ||||||||||
| 31 | user_authors_arent => { | ||||||||||
| 32 | 'x.name.is_plural' => 1, | ||||||||||
| 33 | 'x.name.singular' => 'user_author_isnt', | ||||||||||
| 34 | schema => ['array*', of=>'str*'], | ||||||||||
| 35 | element_completion => \&App::lcpan::_complete_cpanid, | ||||||||||
| 36 | }, | ||||||||||
| 37 | %App::lcpan::fctime_args, | ||||||||||
| 38 | %App::lcpan::fmtime_args, | ||||||||||
| 39 | }, | ||||||||||
| 40 | }; | ||||||||||
| 41 | 0 | ▶ | sub handle_cmd { | ||||||||
|
Subroutine
handle_cmd: not called CC=3 SCAR=24.8
Pod
documented
| |||||||||||
| 42 | 0 | my %args = @_; | |||||||||
| 43 | |||||||||||
| 44 | 0 | my $author = $args{author}; | |||||||||
| 45 | |||||||||||
| 46 | 0 | my $res = App::lcpan::modules( | |||||||||
| 47 | hash_subset(\%args, \%App::lcpan::common_args, \%App::lcpan::author_args), | ||||||||||
| 48 | ); | ||||||||||
| 49 | 0 | ▶ | return $res if $res->[0] != 200; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 50 | |||||||||||
| 51 | 0 | my $mods = $res->[2]; | |||||||||
| 52 | 0 | my %rdeps_args = %args; | |||||||||
| 53 | 0 | $rdeps_args{modules} = $mods; | |||||||||
| 54 | 0 | delete $rdeps_args{author}; | |||||||||
| 55 | 0 | delete $rdeps_args{authors}; | |||||||||
| 56 | 0 | delete $rdeps_args{authors_arent}; | |||||||||
| 57 | 0 | $rdeps_args{authors} = delete $args{user_authors}; | |||||||||
| 58 | 0 | $rdeps_args{authors_arent} = delete $args{user_authors_arent}; | |||||||||
| 59 | 0 | $rdeps_args{phase} = delete $args{phase}; | |||||||||
| 60 | 0 | $rdeps_args{rel} = delete $args{rel}; | |||||||||
| 61 | 0 | $rdeps_args{added_since} = delete $args{added_since}; | |||||||||
| 62 | 0 | $rdeps_args{updated_since} = delete $args{updated_since}; | |||||||||
| 63 | 0 | $rdeps_args{added_or_updated_since} = delete $args{added_or_updated_since}; | |||||||||
| 64 | 0 | $res = App::lcpan::rdeps(%rdeps_args); | |||||||||
| 65 | 0 | ▶ | return $res if $res->[0] != 200; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 66 | |||||||||||
| 67 | 0 | $res; | |||||||||
| 68 | } | ||||||||||
| 69 | |||||||||||
| 70 | 1 | 1; | |||||||||
| 71 | # ABSTRACT: Find distributions that use one of author's modules | ||||||||||
| 72 | |||||||||||
| 73 | __END__ | ||||||||||