blib/lib/Getopt/Long/Negate/EN.pm

filter: Statementstmt 95.1% 39 / 41 Branchbran 95.6% 44 / 46 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 5 / 5 Podpod 100% 1 / 1 totaltotal 95.7% 89 / 93 CC 24 SCAR 30.3
CC
24
Cov
95%
negations_for_option
24.1
BEGIN
1.0
BEGIN
1.0
CRAP 20.8
↑ Summary
1 package Getopt::Long::Negate::EN;
2  
3 2 our $DATE = '2019-04-23'; # DATE
4 2 our $VERSION = '0.060'; # VERSION
5  
6 2 ▶use 5.010001;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 2 ▶use Exporter qw(import);
Subroutine BEGIN: called CC=1 SCAR=0.0
11 2 our @EXPORT_OK = qw(negations_for_option);
12  
13 23 ▶sub negations_for_option {
Subroutine negations_for_option: called CC=24 SCAR=31.8
Pod documented
14 23 my $word = shift;
15  
16 23 ▶ if ($word =~ /\Awith([_-].+)/ ) { return ("without$1") }
Branch: 23 branches
BranchTrueFalseTotal
if ($word =~ /\Awith([_-].+)/) { } 1 22 23
elsif ($word =~ /\Awithout([_-].+)/) { } 1 21 22
elsif ($word =~ /\Ais([_-].+)/) { } 1 20 21
elsif ($word =~ /\Aisnt([_-].+)/) { } 1 19 20
elsif ($word =~ /\Aare([_-].+)/) { } 1 18 19
elsif ($word =~ /\Aarent([_-].+)/) { } 1 17 18
elsif ($word =~ /\Ahas([_-].+)/) { } 1 16 17
elsif ($word =~ /\Ahave([_-].+)/) { } 1 15 16
elsif ($word =~ /\Ahasnt([_-].+)/) { } 1 14 15
elsif ($word =~ /\Ahavent([_-].+)/) { } 1 13 14
elsif ($word =~ /\Acan([_-].+)/) { } 1 12 13
elsif ($word =~ /\Acant([_-].+)/) { } 1 11 12
elsif ($word =~ /\Aenabled([_-].+)/) { } 1 10 11
elsif ($word =~ /\Adisabled([_-].+)/) { } 1 9 10
elsif ($word =~ /\Aenable([_-].+)/) { } 1 8 9
elsif ($word =~ /\Adisable([_-].+)/) { } 1 7 8
elsif ($word =~ /\Aallowed([_-].+)/) { } 1 6 7
elsif ($word =~ /\Adisallowed([_-].+)/) { } 1 5 6
elsif ($word =~ /\Aallow([_-].+)/) { } 1 4 5
elsif ($word =~ /\Adisallow([_-].+)/) { } 1 3 4
elsif ($word =~ /\Ainclude([_-].+)/) { } 0 3 3
elsif ($word =~ /\Aexclude([_-].+)/) { } 0 3 3
elsif ($word =~ /\Ano[_-](.+)/) { } 2 1 3
17 1 elsif ($word =~ /\Awithout([_-].+)/) { return ("with$1") }
18  
19 1 elsif ($word =~ /\Ais([_-].+)/ ) { return ("isnt$1") }
20 1 elsif ($word =~ /\Aisnt([_-].+)/ ) { return ("is$1") }
21 1 elsif ($word =~ /\Aare([_-].+)/ ) { return ("arent$1") }
22 1 elsif ($word =~ /\Aarent([_-].+)/ ) { return ("are$1") }
23  
24 1 elsif ($word =~ /\Ahas([_-].+)/ ) { return ("hasnt$1") }
25 1 elsif ($word =~ /\Ahave([_-].+)/ ) { return ("havent$1") }
26 1 elsif ($word =~ /\Ahasnt([_-].+)/ ) { return ("has$1") }
27 1 elsif ($word =~ /\Ahavent([_-].+)/ ) { return ("have$1") }
28  
29 1 elsif ($word =~ /\Acan([_-].+)/ ) { return ("cant$1") }
30 1 elsif ($word =~ /\Acant([_-].+)/ ) { return ("can$1") }
31  
32 1 elsif ($word =~ /\Aenabled([_-].+)/ ) { return ("disabled$1") }
33 1 elsif ($word =~ /\Adisabled([_-].+)/) { return ("enabled$1") }
34 1 elsif ($word =~ /\Aenable([_-].+)/ ) { return ("disable$1") }
35 1 elsif ($word =~ /\Adisable([_-].+)/) { return ("enable$1") }
36  
37 1 elsif ($word =~ /\Aallowed([_-].+)/ ) { return ("disallowed$1") }
38 1 elsif ($word =~ /\Adisallowed([_-].+)/) { return ("allowed$1") }
39 1 elsif ($word =~ /\Aallow([_-].+)/ ) { return ("disallow$1") }
40 1 elsif ($word =~ /\Adisallow([_-].+)/) { return ("allow$1") }
41  
42 0 elsif ($word =~ /\Ainclude([_-].+)/ ) { return ("exclude$1") }
43 0 elsif ($word =~ /\Aexclude([_-].+)/ ) { return ("include$1") }
44  
45 2 elsif ($word =~ /\Ano[_-](.+)/ ) { return ($1) }
46  
47 else {
48 # default from Getopt::Long
49 1 return ("no-$word", "no$word");
50 }
51 }
52  
53 2 1;
54 # ABSTRACT: Better negation of boolean option names
55  
56 __END__
↑ Summary