| 1 | package Perinci::Sub::XCompletion::sortsub_spec; | ||||||||||||||||||||
| 2 | |||||||||||||||||||||
| 3 | 1 | our $AUTHORITY = 'cpan:PERLANCAR'; # AUTHORITY | |||||||||||||||||||
| 4 | 1 | our $DATE = '2020-05-27'; # DATE | |||||||||||||||||||
| 5 | 1 | our $DIST = 'Sah-Schemas-SortSub'; # DIST | |||||||||||||||||||
| 6 | 1 | our $VERSION = '0.004'; # VERSION | |||||||||||||||||||
| 7 | |||||||||||||||||||||
| 8 | 1 | ▶ | use 5.010001; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 9 | 1 | ▶ | use strict; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 10 | 1 | ▶ | use warnings; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 11 | 1 | ▶ | use Log::ger; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 12 | |||||||||||||||||||||
| 13 | 1 | our %SPEC; | |||||||||||||||||||
| 14 | |||||||||||||||||||||
| 15 | $SPEC{gen_completion} = { | ||||||||||||||||||||
| 16 | 1 | v => 1.1, | |||||||||||||||||||
| 17 | }; | ||||||||||||||||||||
| 18 | 0 | ▶ | sub gen_completion { | ||||||||||||||||||
|
Subroutine
gen_completion: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||
| 19 | 0 | require Complete::Sequence; | |||||||||||||||||||
| 20 | 0 | require Complete::Util; | |||||||||||||||||||
| 21 | 0 | require Module::List::Tiny; | |||||||||||||||||||
| 22 | |||||||||||||||||||||
| 23 | 0 | my %fargs = @_; | |||||||||||||||||||
| 24 | |||||||||||||||||||||
| 25 | 0 | ▶ | sub { | ||||||||||||||||||
|
Subroutine
__ANON__: not called CC=2 SCAR=17.9
| |||||||||||||||||||||
| 26 | 0 | my %cargs = @_; | |||||||||||||||||||
| 27 | 0 | ▶ | my $word = $cargs{word} // ''; | ||||||||||||||||||
|
Condition0%0/2
$cargs{"word"} // ""
MC/DC0%0/1
$cargs{"word"} // ""
$cargs{"word"}
Truth table0%0/2
A
A= $cargs{"word"}
| |||||||||||||||||||||
| 28 | |||||||||||||||||||||
| 29 | Complete::Sequence::complete_sequence( | ||||||||||||||||||||
| 30 | word => $word, | ||||||||||||||||||||
| 31 | sequence => [ | ||||||||||||||||||||
| 32 | 0 | ▶ | sub { | ||||||||||||||||||
|
Subroutine
__ANON__: not called CC=5 SCAR=34.0
| |||||||||||||||||||||
| 33 | 0 | my $mods = Module::List::Tiny::list_modules("Sort::Sub::", {list_modules=>1}); | |||||||||||||||||||
| 34 | 0 | my @words; | |||||||||||||||||||
| 35 | 0 | for (sort keys %$mods) { | |||||||||||||||||||
| 36 | 0 | s/\ASort::Sub:://; | |||||||||||||||||||
| 37 | 0 | ▶ | push @words, $_ if $cargs{offer_unprefixed} // 1; | ||||||||||||||||||
|
Branch: 1 branch
Condition0%0/2
$cargs{"offer_unprefixed"} // 1
MC/DC0%0/1
$cargs{"offer_unprefixed"} // 1
$cargs{"offer_unprefixed"}
Truth table0%0/2
A
A= $cargs{"offer_unprefixed"}
| |||||||||||||||||||||
| 38 | 0 | ▶ | push @words, "\$$_" if $cargs{offer_dollar_prefixed}; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 39 | } | ||||||||||||||||||||
| 40 | 0 | \@words; | |||||||||||||||||||
| 41 | }, | ||||||||||||||||||||
| 42 | 0 | ["", "<>", "<i>", "<r>", "<ir>"], | |||||||||||||||||||
| 43 | ], | ||||||||||||||||||||
| 44 | ); | ||||||||||||||||||||
| 45 | 0 | }; | |||||||||||||||||||
| 46 | } | ||||||||||||||||||||
| 47 | |||||||||||||||||||||
| 48 | 1 | 1; | |||||||||||||||||||
| 49 | # ABSTRACT: Generate completion for Sort::Sub spec | ||||||||||||||||||||
| 50 | |||||||||||||||||||||
| 51 | __END__ | ||||||||||||||||||||