blib/lib/Getopt/EX/Factotum.pm

filter: Statementstmt 69.2% 9 / 13 Branchbran 0.0% 0 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 75.0% 3 / 4 Podpod 0.0% 0 / 1 totaltotal 54.5% 12 / 22 CC 3 SCAR 18.7
CC
3
Cov
53%
load
12.0
BEGIN
1.0
BEGIN
1.0
CRAP 6.5
« lib/IO/Factotum.pm ↑ Summary lib/IO/Factotum/ARGV.pm »
1 package Getopt::EX::Factotum;
2  
3 1 ▶use v5.16;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 1 ▶use IO::Factotum;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 # -MFactotum::load=NAME calls load(NAME => 1): the converter of
9 # IO::Factotum::NAME is registered. ARGV is not tied here; the
10 # program opens its files by IO::Factotum::open_input.
11 0 ▶sub load {
Subroutine load: not called CC=3 SCAR=24.8
Pod undocumented
12 0 my @names;
13 0 ▶ while (my($name, $val) = splice @_, 0, 2) {
Branch: 1 branch
BranchTrueFalseTotal
if (() = splice(@_, 0, 2)) 0 0 0
14 0 ▶ push @names, $name if $val;
Branch: 1 branch
BranchTrueFalseTotal
if $val 0 0 0
15 }
16 0 IO::Factotum::load(@names);
17 }
18  
19 1 1;
20  
21 =encoding utf-8
22  
23 =head1 NAME
24  
25 Getopt::EX::Factotum - Getopt::EX module to load IO::Factotum converters
26  
27 =head1 SYNOPSIS
28  
29 ansicolumn -MFactotum::load=skylighting file.c file.h
30  
31 =head1 DESCRIPTION
32  
33 This is a module of L<Getopt::EX> for the commands which open their
34 files by C<IO::Factotum::open_input>.
35  
36 Note that L<optex|App::optex> takes a C<-M> option after the command
37 name as its own module, when it can load it. L<ansicolumn|App::ansicolumn>
38 has the C<--factotum> option, which does the same and is not taken.
39  
40 =over 4
41  
42 =item B<load>=I<name>
43  
44 Register the converter of C<IO::Factotum::>I<name>
45 (C<IO::Factotum::load>).
46  
47 =back
48  
49 =head1 SEE ALSO
50  
51 L<IO::Factotum>, L<IO::Factotum::skylighting>, L<Getopt::EX>
52  
53 =cut
54  
55 __DATA__
« lib/IO/Factotum.pm ↑ Summary lib/IO/Factotum/ARGV.pm »