| 1 | package App::Ack::ConfigLoader; | ||||||||||||||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||||||||||||||
| 3 | 582 | ▶ | use strict; | ||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||
| 4 | 582 | ▶ | use warnings; | ||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||
| 5 | 582 | ▶ | use 5.010; | ||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||
| 6 | |||||||||||||||||||||||||||||||||||||||||
| 7 | 582 | ▶ | use App::Ack (); | ||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||
| 8 | 582 | ▶ | use App::Ack::ConfigDefault (); | ||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||
| 9 | 582 | ▶ | use App::Ack::ConfigFinder (); | ||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||
| 10 | 582 | ▶ | use App::Ack::Filter (); | ||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||
| 11 | 582 | ▶ | use App::Ack::Filter::Collection (); | ||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||
| 12 | 582 | ▶ | use App::Ack::Filter::Default (); | ||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||
| 13 | 582 | ▶ | use App::Ack::Filter::IsPath (); | ||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||
| 14 | 582 | ▶ | use File::Spec 3.00 (); | ||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||
| 15 | 582 | ▶ | use Getopt::Long 2.38 (); | ||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||
| 16 | 582 | ▶ | use Text::ParseWords 3.1 (); | ||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||
| 17 | |||||||||||||||||||||||||||||||||||||||||
| 18 | 4375 | ▶ | sub configure_parser { | ||||||||||||||||||||||||||||||||||||||
|
Subroutine
configure_parser: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||
| 19 | 4375 | my @opts = @_; | |||||||||||||||||||||||||||||||||||||||
| 20 | |||||||||||||||||||||||||||||||||||||||||
| 21 | 4375 | my @standard = qw( | |||||||||||||||||||||||||||||||||||||||
| 22 | default | ||||||||||||||||||||||||||||||||||||||||
| 23 | bundling | ||||||||||||||||||||||||||||||||||||||||
| 24 | no_auto_help | ||||||||||||||||||||||||||||||||||||||||
| 25 | no_auto_version | ||||||||||||||||||||||||||||||||||||||||
| 26 | no_ignore_case | ||||||||||||||||||||||||||||||||||||||||
| 27 | ); | ||||||||||||||||||||||||||||||||||||||||
| 28 | 4375 | Getopt::Long::Configure( @standard, @opts ); | |||||||||||||||||||||||||||||||||||||||
| 29 | |||||||||||||||||||||||||||||||||||||||||
| 30 | 4375 | return; | |||||||||||||||||||||||||||||||||||||||
| 31 | } | ||||||||||||||||||||||||||||||||||||||||
| 32 | |||||||||||||||||||||||||||||||||||||||||
| 33 | |||||||||||||||||||||||||||||||||||||||||
| 34 | 2060 | ▶ | sub _generate_ignore_dir { | ||||||||||||||||||||||||||||||||||||||
|
Subroutine
_generate_ignore_dir: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||
| 35 | 2060 | my ( $option_name, $opt ) = @_; | |||||||||||||||||||||||||||||||||||||||
| 36 | |||||||||||||||||||||||||||||||||||||||||
| 37 | 2060 | my $is_inverted = $option_name =~ /^--no/; | |||||||||||||||||||||||||||||||||||||||
| 38 | |||||||||||||||||||||||||||||||||||||||||
| 39 | 10899 | ▶ | return sub { | ||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=9 SCAR=22.0
| |||||||||||||||||||||||||||||||||||||||||
| 40 | 10899 | my ( undef, $dir ) = @_; | |||||||||||||||||||||||||||||||||||||||
| 41 | |||||||||||||||||||||||||||||||||||||||||
| 42 | 10899 | $dir = _remove_directory_separator( $dir ); | |||||||||||||||||||||||||||||||||||||||
| 43 | 10899 | ▶ | if ( $dir !~ /:/ ) { | ||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||
| 44 | 27 | $dir = 'is:' . $dir; | |||||||||||||||||||||||||||||||||||||||
| 45 | } | ||||||||||||||||||||||||||||||||||||||||
| 46 | |||||||||||||||||||||||||||||||||||||||||
| 47 | 10899 | my ( $filter_type, $args ) = split /:/, $dir, 2; | |||||||||||||||||||||||||||||||||||||||
| 48 | |||||||||||||||||||||||||||||||||||||||||
| 49 | 10899 | ▶ | if ( $filter_type eq 'firstlinematch' ) { | ||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||
| 50 | 1 | App::Ack::die( qq{Invalid filter specification "$filter_type" for option '$option_name'} ); | |||||||||||||||||||||||||||||||||||||||
| 51 | } | ||||||||||||||||||||||||||||||||||||||||
| 52 | |||||||||||||||||||||||||||||||||||||||||
| 53 | 10898 | my $filter = App::Ack::Filter->create_filter($filter_type, split(/,/, $args)); | |||||||||||||||||||||||||||||||||||||||
| 54 | 10898 | my $collection; | |||||||||||||||||||||||||||||||||||||||
| 55 | |||||||||||||||||||||||||||||||||||||||||
| 56 | 10898 | ▶ | my $previous_inversion_matches = $opt->{idirs} && !($is_inverted xor $opt->{idirs}[-1]->is_inverted()); | ||||||||||||||||||||||||||||||||||||||
|
Condition100%7/7
$opt->{'idirs'} && !($is_inverted ^^ $opt->{'idirs'}[-1]->is_inverted)
$is_inverted ^^ $opt->{"idirs"}[-1]->is_inverted
MC/DC100%3/3
$opt->{'idirs'} && !($is_inverted ^^ $opt->{'idirs'}[-1]->is_inverted)
$opt->{'idirs'}
$is_inverted
$opt->{"idirs"}[-1]->is_inverted
Truth table100%5/5
A && not(B ^^ C)
A= $opt->{'idirs'}B= $is_invertedC= $opt->{"idirs"}[-1]->is_inverted
| |||||||||||||||||||||||||||||||||||||||||
| 57 | |||||||||||||||||||||||||||||||||||||||||
| 58 | 10898 | ▶ | if ( $previous_inversion_matches ) { | ||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||
| 59 | 10493 | $collection = $opt->{idirs}[-1]; | |||||||||||||||||||||||||||||||||||||||
| 60 | |||||||||||||||||||||||||||||||||||||||||
| 61 | 10493 | ▶ | if ( $is_inverted ) { | ||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||
| 62 | # This relies on invert of an inverted filter to return the original. | ||||||||||||||||||||||||||||||||||||||||
| 63 | 1 | $collection = $collection->invert(); | |||||||||||||||||||||||||||||||||||||||
| 64 | } | ||||||||||||||||||||||||||||||||||||||||
| 65 | } | ||||||||||||||||||||||||||||||||||||||||
| 66 | else { | ||||||||||||||||||||||||||||||||||||||||
| 67 | 405 | $collection = App::Ack::Filter::Collection->new(); | |||||||||||||||||||||||||||||||||||||||
| 68 | 405 | ▶ | push @{ $opt->{idirs} }, $is_inverted ? $collection->invert() : $collection; | ||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||
| 69 | } | ||||||||||||||||||||||||||||||||||||||||
| 70 | |||||||||||||||||||||||||||||||||||||||||
| 71 | 10898 | $collection->add($filter); | |||||||||||||||||||||||||||||||||||||||
| 72 | |||||||||||||||||||||||||||||||||||||||||
| 73 | 10898 | ▶ | if ( $filter_type eq 'is' ) { | ||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||
| 74 | 10892 | $collection->add(App::Ack::Filter::IsPath->new($args)); | |||||||||||||||||||||||||||||||||||||||
| 75 | } | ||||||||||||||||||||||||||||||||||||||||
| 76 | 2060 | }; | |||||||||||||||||||||||||||||||||||||||
| 77 | } | ||||||||||||||||||||||||||||||||||||||||
| 78 | |||||||||||||||||||||||||||||||||||||||||
| 79 | |||||||||||||||||||||||||||||||||||||||||
| 80 | 10899 | ▶ | sub _remove_directory_separator { | ||||||||||||||||||||||||||||||||||||||
|
Subroutine
_remove_directory_separator: called CC=2 SCAR=7.0
| |||||||||||||||||||||||||||||||||||||||||
| 81 | 10899 | my $path = shift; | |||||||||||||||||||||||||||||||||||||||
| 82 | |||||||||||||||||||||||||||||||||||||||||
| 83 | 10899 | ▶ | state $dir_sep_chars = $App::Ack::is_windows ? quotemeta( '\\/' ) : quotemeta( File::Spec->catfile( '', '' ) ); | ||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||
| 84 | |||||||||||||||||||||||||||||||||||||||||
| 85 | 10899 | $path =~ s/[$dir_sep_chars]$//; | |||||||||||||||||||||||||||||||||||||||
| 86 | |||||||||||||||||||||||||||||||||||||||||
| 87 | 10899 | return $path; | |||||||||||||||||||||||||||||||||||||||
| 88 | } | ||||||||||||||||||||||||||||||||||||||||
| 89 | |||||||||||||||||||||||||||||||||||||||||
| 90 | |||||||||||||||||||||||||||||||||||||||||
| 91 | 56771 | ▶ | sub _process_filter_spec { | ||||||||||||||||||||||||||||||||||||||
|
Subroutine
_process_filter_spec: called CC=4 SCAR=14.0
| |||||||||||||||||||||||||||||||||||||||||
| 92 | 56771 | my ( $spec ) = @_; | |||||||||||||||||||||||||||||||||||||||
| 93 | |||||||||||||||||||||||||||||||||||||||||
| 94 | 56771 | ▶ | if ( $spec =~ /^(\w+):(\w+):(.*)/ ) { | ||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||
| 95 | 56205 | my ( $type_name, $ext_type, $arguments ) = ( $1, $2, $3 ); | |||||||||||||||||||||||||||||||||||||||
| 96 | |||||||||||||||||||||||||||||||||||||||||
| 97 | 56205 | return ( $type_name, | |||||||||||||||||||||||||||||||||||||||
| 98 | App::Ack::Filter->create_filter($ext_type, split(/,/, $arguments)) ); | ||||||||||||||||||||||||||||||||||||||||
| 99 | } | ||||||||||||||||||||||||||||||||||||||||
| 100 | elsif ( $spec =~ /^(\w+)=(.*)/ ) { # Check to see if we have ack1-style argument specification. | ||||||||||||||||||||||||||||||||||||||||
| 101 | 566 | my ( $type_name, $extensions ) = ( $1, $2 ); | |||||||||||||||||||||||||||||||||||||||
| 102 | |||||||||||||||||||||||||||||||||||||||||
| 103 | 566 | my @extensions = split(/,/, $extensions); | |||||||||||||||||||||||||||||||||||||||
| 104 | 566 | foreach my $extension ( @extensions ) { | |||||||||||||||||||||||||||||||||||||||
| 105 | 1128 | $extension =~ s/^[.]//; | |||||||||||||||||||||||||||||||||||||||
| 106 | } | ||||||||||||||||||||||||||||||||||||||||
| 107 | |||||||||||||||||||||||||||||||||||||||||
| 108 | 566 | return ( $type_name, App::Ack::Filter->create_filter('ext', @extensions) ); | |||||||||||||||||||||||||||||||||||||||
| 109 | } | ||||||||||||||||||||||||||||||||||||||||
| 110 | else { | ||||||||||||||||||||||||||||||||||||||||
| 111 | 0 | App::Ack::die( "Invalid filter specification '$spec'" ); | |||||||||||||||||||||||||||||||||||||||
| 112 | } | ||||||||||||||||||||||||||||||||||||||||
| 113 | } | ||||||||||||||||||||||||||||||||||||||||
| 114 | |||||||||||||||||||||||||||||||||||||||||
| 115 | |||||||||||||||||||||||||||||||||||||||||
| 116 | 94 | ▶ | sub _uninvert_filter { | ||||||||||||||||||||||||||||||||||||||
|
Subroutine
_uninvert_filter: called CC=6 SCAR=18.2
| |||||||||||||||||||||||||||||||||||||||||
| 117 | 94 | my ( $opt, @filters ) = @_; | |||||||||||||||||||||||||||||||||||||||
| 118 | |||||||||||||||||||||||||||||||||||||||||
| 119 | 94 | ▶ | return unless defined $opt->{filters} && @filters; | ||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
defined $opt->{"filters"} and @filters
MC/DC50%1/2
defined $opt->{"filters"} and @filters
defined $opt->{"filters"}
@filters
Truth table66%2/3
A and B
A= defined $opt->{"filters"}B= @filters
| |||||||||||||||||||||||||||||||||||||||||
| 120 | |||||||||||||||||||||||||||||||||||||||||
| 121 | # Loop through all the registered filters. If we hit one that | ||||||||||||||||||||||||||||||||||||||||
| 122 | # matches this extension and it's inverted, we need to delete it from | ||||||||||||||||||||||||||||||||||||||||
| 123 | # the options. | ||||||||||||||||||||||||||||||||||||||||
| 124 | 2 | ▶ | for ( my $i = 0; $i < @{ $opt->{filters} }; $i++ ) { | ||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||
| 125 | 2 | my $opt_filter = @{ $opt->{filters} }[$i]; | |||||||||||||||||||||||||||||||||||||||
| 126 | |||||||||||||||||||||||||||||||||||||||||
| 127 | 2 | ▶ | if ( $opt_filter->is_inverted() | ||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
$opt_filter->is_inverted and grep {$_ == $opt_filter->{"filter"};} @filters
MC/DC0%0/2
$opt_filter->is_inverted and grep {$_ == $opt_filter->{"filter"};} @filters
$opt_filter->is_inverted
grep {$_ == $opt_filter->{"filter"};} @filters
Truth table33%1/3
A and B
A= $opt_filter->is_invertedB= grep {$_ == $opt_filter->{"filter"};} @filters
| |||||||||||||||||||||||||||||||||||||||||
| 128 | 2 | && grep { $_ == $opt_filter->{filter} } @filters ) | |||||||||||||||||||||||||||||||||||||||
| 129 | { | ||||||||||||||||||||||||||||||||||||||||
| 130 | 2 | splice @{ $opt->{filters} }, $i, 1; | |||||||||||||||||||||||||||||||||||||||
| 131 | 2 | $i--; | |||||||||||||||||||||||||||||||||||||||
| 132 | } | ||||||||||||||||||||||||||||||||||||||||
| 133 | } | ||||||||||||||||||||||||||||||||||||||||
| 134 | |||||||||||||||||||||||||||||||||||||||||
| 135 | 2 | return; | |||||||||||||||||||||||||||||||||||||||
| 136 | } | ||||||||||||||||||||||||||||||||||||||||
| 137 | |||||||||||||||||||||||||||||||||||||||||
| 138 | |||||||||||||||||||||||||||||||||||||||||
| 139 | 602 | ▶ | sub _process_filetypes { | ||||||||||||||||||||||||||||||||||||||
|
Subroutine
_process_filetypes: called CC=3 SCAR=11.9
| |||||||||||||||||||||||||||||||||||||||||
| 140 | 602 | my ( $opt, $arg_sources ) = @_; | |||||||||||||||||||||||||||||||||||||||
| 141 | |||||||||||||||||||||||||||||||||||||||||
| 142 | 602 | my %additional_specs; | |||||||||||||||||||||||||||||||||||||||
| 143 | |||||||||||||||||||||||||||||||||||||||||
| 144 | 56768 | ▶ | my $add_spec = sub { | ||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||
| 145 | 56768 | my ( undef, $spec ) = @_; | |||||||||||||||||||||||||||||||||||||||
| 146 | |||||||||||||||||||||||||||||||||||||||||
| 147 | 56768 | my ( $name, $filter ) = _process_filter_spec($spec); | |||||||||||||||||||||||||||||||||||||||
| 148 | |||||||||||||||||||||||||||||||||||||||||
| 149 | 56767 | push @{ $App::Ack::mappings{$name} }, $filter; | |||||||||||||||||||||||||||||||||||||||
| 150 | |||||||||||||||||||||||||||||||||||||||||
| 151 | 102 | ▶ | $additional_specs{$name . '!'} = sub { | ||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=2 SCAR=6.9
| |||||||||||||||||||||||||||||||||||||||||
| 152 | 102 | my ( undef, $value ) = @_; | |||||||||||||||||||||||||||||||||||||||
| 153 | |||||||||||||||||||||||||||||||||||||||||
| 154 | 102 | my @filters = @{ $App::Ack::mappings{$name} }; | |||||||||||||||||||||||||||||||||||||||
| 155 | 102 | ▶ | if ( not $value ) { | ||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||
| 156 | 8 | @filters = map { $_->invert() } @filters; | |||||||||||||||||||||||||||||||||||||||
| 157 | } | ||||||||||||||||||||||||||||||||||||||||
| 158 | else { | ||||||||||||||||||||||||||||||||||||||||
| 159 | 94 | _uninvert_filter( $opt, @filters ); | |||||||||||||||||||||||||||||||||||||||
| 160 | } | ||||||||||||||||||||||||||||||||||||||||
| 161 | |||||||||||||||||||||||||||||||||||||||||
| 162 | 102 | push @{ $opt->{'filters'} }, @filters; | |||||||||||||||||||||||||||||||||||||||
| 163 | 56767 | }; | |||||||||||||||||||||||||||||||||||||||
| 164 | 602 | }; | |||||||||||||||||||||||||||||||||||||||
| 165 | |||||||||||||||||||||||||||||||||||||||||
| 166 | 3 | ▶ | my $set_spec = sub { | ||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=3.3
| |||||||||||||||||||||||||||||||||||||||||
| 167 | 3 | my ( undef, $spec ) = @_; | |||||||||||||||||||||||||||||||||||||||
| 168 | |||||||||||||||||||||||||||||||||||||||||
| 169 | 3 | my ( $name, $filter ) = _process_filter_spec($spec); | |||||||||||||||||||||||||||||||||||||||
| 170 | |||||||||||||||||||||||||||||||||||||||||
| 171 | 3 | $App::Ack::mappings{$name} = [ $filter ]; | |||||||||||||||||||||||||||||||||||||||
| 172 | |||||||||||||||||||||||||||||||||||||||||
| 173 | 0 | ▶ | $additional_specs{$name . '!'} = sub { | ||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=2 SCAR=17.9
| |||||||||||||||||||||||||||||||||||||||||
| 174 | 0 | my ( undef, $value ) = @_; | |||||||||||||||||||||||||||||||||||||||
| 175 | |||||||||||||||||||||||||||||||||||||||||
| 176 | 0 | my @filters = @{ $App::Ack::mappings{$name} }; | |||||||||||||||||||||||||||||||||||||||
| 177 | 0 | ▶ | if ( not $value ) { | ||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||
| 178 | 0 | @filters = map { $_->invert() } @filters; | |||||||||||||||||||||||||||||||||||||||
| 179 | } | ||||||||||||||||||||||||||||||||||||||||
| 180 | else { | ||||||||||||||||||||||||||||||||||||||||
| 181 | 0 | _uninvert_filter( $opt, @filters ); | |||||||||||||||||||||||||||||||||||||||
| 182 | } | ||||||||||||||||||||||||||||||||||||||||
| 183 | |||||||||||||||||||||||||||||||||||||||||
| 184 | 0 | push @{ $opt->{'filters'} }, @filters; | |||||||||||||||||||||||||||||||||||||||
| 185 | 3 | }; | |||||||||||||||||||||||||||||||||||||||
| 186 | 602 | }; | |||||||||||||||||||||||||||||||||||||||
| 187 | |||||||||||||||||||||||||||||||||||||||||
| 188 | 6 | ▶ | my $delete_spec = sub { | ||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||
| 189 | 6 | my ( undef, $name ) = @_; | |||||||||||||||||||||||||||||||||||||||
| 190 | |||||||||||||||||||||||||||||||||||||||||
| 191 | 6 | delete $App::Ack::mappings{$name}; | |||||||||||||||||||||||||||||||||||||||
| 192 | 6 | delete $additional_specs{$name . '!'}; | |||||||||||||||||||||||||||||||||||||||
| 193 | 602 | }; | |||||||||||||||||||||||||||||||||||||||
| 194 | |||||||||||||||||||||||||||||||||||||||||
| 195 | 602 | my %type_arg_specs = ( | |||||||||||||||||||||||||||||||||||||||
| 196 | 'type-add=s' => $add_spec, | ||||||||||||||||||||||||||||||||||||||||
| 197 | 'type-set=s' => $set_spec, | ||||||||||||||||||||||||||||||||||||||||
| 198 | 'type-del=s' => $delete_spec, | ||||||||||||||||||||||||||||||||||||||||
| 199 | ); | ||||||||||||||||||||||||||||||||||||||||
| 200 | |||||||||||||||||||||||||||||||||||||||||
| 201 | 602 | configure_parser( 'no_auto_abbrev', 'pass_through' ); | |||||||||||||||||||||||||||||||||||||||
| 202 | 602 | foreach my $source (@{$arg_sources}) { | |||||||||||||||||||||||||||||||||||||||
| 203 | 1177 | my $args = $source->{contents}; | |||||||||||||||||||||||||||||||||||||||
| 204 | |||||||||||||||||||||||||||||||||||||||||
| 205 | 1177 | ▶ | if ( ref($args) ) { | ||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||
| 206 | # $args are modified in place, so no need to munge $arg_sources | ||||||||||||||||||||||||||||||||||||||||
| 207 | 1177 | Getopt::Long::GetOptionsFromArray( $args, %type_arg_specs ); | |||||||||||||||||||||||||||||||||||||||
| 208 | } | ||||||||||||||||||||||||||||||||||||||||
| 209 | else { | ||||||||||||||||||||||||||||||||||||||||
| 210 | 0 | ( undef, $source->{contents} ) = | |||||||||||||||||||||||||||||||||||||||
| 211 | Getopt::Long::GetOptionsFromString( $args, %type_arg_specs ); | ||||||||||||||||||||||||||||||||||||||||
| 212 | } | ||||||||||||||||||||||||||||||||||||||||
| 213 | } | ||||||||||||||||||||||||||||||||||||||||
| 214 | |||||||||||||||||||||||||||||||||||||||||
| 215 | 0 | ▶ | $additional_specs{'k|known-types'} = sub { | ||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||||||||||||||
| 216 | 0 | my @filters = map { @{$_} } values(%App::Ack::mappings); | |||||||||||||||||||||||||||||||||||||||
| 217 | |||||||||||||||||||||||||||||||||||||||||
| 218 | 0 | push @{ $opt->{'filters'} }, @filters; | |||||||||||||||||||||||||||||||||||||||
| 219 | 602 | }; | |||||||||||||||||||||||||||||||||||||||
| 220 | |||||||||||||||||||||||||||||||||||||||||
| 221 | 602 | return \%additional_specs; | |||||||||||||||||||||||||||||||||||||||
| 222 | } | ||||||||||||||||||||||||||||||||||||||||
| 223 | |||||||||||||||||||||||||||||||||||||||||
| 224 | |||||||||||||||||||||||||||||||||||||||||
| 225 | 1030 | ▶ | sub get_arg_spec { | ||||||||||||||||||||||||||||||||||||||
|
Subroutine
get_arg_spec: called CC=2 SCAR=7.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||
| 226 | 1030 | my ( $opt, $extra_specs ) = @_; | |||||||||||||||||||||||||||||||||||||||
| 227 | |||||||||||||||||||||||||||||||||||||||||
| 228 | =begin Adding-Options | ||||||||||||||||||||||||||||||||||||||||
| 229 | |||||||||||||||||||||||||||||||||||||||||
| 230 | *** IF YOU ARE MODIFYING ACK PLEASE READ THIS *** | ||||||||||||||||||||||||||||||||||||||||
| 231 | |||||||||||||||||||||||||||||||||||||||||
| 232 | If you plan to add a new option to ack, please make sure of | ||||||||||||||||||||||||||||||||||||||||
| 233 | the following: | ||||||||||||||||||||||||||||||||||||||||
| 234 | |||||||||||||||||||||||||||||||||||||||||
| 235 | * Your new option has a test underneath the t/ directory. | ||||||||||||||||||||||||||||||||||||||||
| 236 | * Your new option is explained when a user invokes ack --help. | ||||||||||||||||||||||||||||||||||||||||
| 237 | (See App::Ack::show_help) | ||||||||||||||||||||||||||||||||||||||||
| 238 | * Your new option is explained when a user invokes ack --man. | ||||||||||||||||||||||||||||||||||||||||
| 239 | (See the POD at the end of ./ack) | ||||||||||||||||||||||||||||||||||||||||
| 240 | * Add your option to t/config-loader.t | ||||||||||||||||||||||||||||||||||||||||
| 241 | * Add your option to t/Util.pm#get_expected_options | ||||||||||||||||||||||||||||||||||||||||
| 242 | * Add your option's description and aliases to dev/generate-completion-scripts.pl | ||||||||||||||||||||||||||||||||||||||||
| 243 | * Go through the list of options already available, and consider | ||||||||||||||||||||||||||||||||||||||||
| 244 | whether your new option can be considered mutex with another option. | ||||||||||||||||||||||||||||||||||||||||
| 245 | |||||||||||||||||||||||||||||||||||||||||
| 246 | =end Adding-Options | ||||||||||||||||||||||||||||||||||||||||
| 247 | |||||||||||||||||||||||||||||||||||||||||
| 248 | =cut | ||||||||||||||||||||||||||||||||||||||||
| 249 | |||||||||||||||||||||||||||||||||||||||||
| 250 | 95 | ▶ | sub _type_handler { | ||||||||||||||||||||||||||||||||||||||
|
Subroutine
_type_handler: called CC=3 SCAR=11.0
| |||||||||||||||||||||||||||||||||||||||||
| 251 | 95 | my ( $getopt, $value ) = @_; | |||||||||||||||||||||||||||||||||||||||
| 252 | |||||||||||||||||||||||||||||||||||||||||
| 253 | 95 | my $cb_value = 1; | |||||||||||||||||||||||||||||||||||||||
| 254 | 95 | ▶ | if ( $value =~ s/^no// ) { | ||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||
| 255 | 3 | $cb_value = 0; | |||||||||||||||||||||||||||||||||||||||
| 256 | } | ||||||||||||||||||||||||||||||||||||||||
| 257 | |||||||||||||||||||||||||||||||||||||||||
| 258 | 95 | my $callback; | |||||||||||||||||||||||||||||||||||||||
| 259 | { | ||||||||||||||||||||||||||||||||||||||||
| 260 | 582 | ▶ | no warnings; | ||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||
| 261 | 95 | $callback = $extra_specs->{ $value . '!' }; | |||||||||||||||||||||||||||||||||||||||
| 262 | } | ||||||||||||||||||||||||||||||||||||||||
| 263 | |||||||||||||||||||||||||||||||||||||||||
| 264 | 95 | ▶ | if ( $callback ) { | ||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||
| 265 | 92 | $callback->( $getopt, $cb_value ); | |||||||||||||||||||||||||||||||||||||||
| 266 | } | ||||||||||||||||||||||||||||||||||||||||
| 267 | else { | ||||||||||||||||||||||||||||||||||||||||
| 268 | 3 | App::Ack::die( "Unknown type '$value'" ); | |||||||||||||||||||||||||||||||||||||||
| 269 | } | ||||||||||||||||||||||||||||||||||||||||
| 270 | |||||||||||||||||||||||||||||||||||||||||
| 271 | 92 | return; | |||||||||||||||||||||||||||||||||||||||
| 272 | } | ||||||||||||||||||||||||||||||||||||||||
| 273 | |||||||||||||||||||||||||||||||||||||||||
| 274 | 1030 | $opt->{and} = []; | |||||||||||||||||||||||||||||||||||||||
| 275 | 1030 | $opt->{or} = []; | |||||||||||||||||||||||||||||||||||||||
| 276 | 1030 | $opt->{not} = []; | |||||||||||||||||||||||||||||||||||||||
| 277 | |||||||||||||||||||||||||||||||||||||||||
| 278 | return { | ||||||||||||||||||||||||||||||||||||||||
| 279 | 0 | ▶ | 1 => sub { $opt->{1} = $opt->{m} = 1 }, | ||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||||||||||||||
| 280 | 'and=s' => $opt->{and}, | ||||||||||||||||||||||||||||||||||||||||
| 281 | 14 | ▶ | 'A|after-context:-1' => sub { shift; $opt->{A} = _context_value(shift) }, | ||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||
| 282 | 12 | ▶ | 'B|before-context:-1' => sub { shift; $opt->{B} = _context_value(shift) }, | ||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||
| 283 | 16 | ▶ | 'C|context:-1' => sub { shift; $opt->{B} = $opt->{A} = _context_value(shift) }, | ||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||
| 284 | 'break!' => \$opt->{break}, | ||||||||||||||||||||||||||||||||||||||||
| 285 | 'c|count' => \$opt->{c}, | ||||||||||||||||||||||||||||||||||||||||
| 286 | 'color|colour!' => \$opt->{color}, | ||||||||||||||||||||||||||||||||||||||||
| 287 | 'color-match=s' => \$ENV{ACK_COLOR_MATCH}, | ||||||||||||||||||||||||||||||||||||||||
| 288 | 'color-filename=s' => \$ENV{ACK_COLOR_FILENAME}, | ||||||||||||||||||||||||||||||||||||||||
| 289 | 'color-colno=s' => \$ENV{ACK_COLOR_COLNO}, | ||||||||||||||||||||||||||||||||||||||||
| 290 | 'color-lineno=s' => \$ENV{ACK_COLOR_LINENO}, | ||||||||||||||||||||||||||||||||||||||||
| 291 | 'column!' => \$opt->{column}, | ||||||||||||||||||||||||||||||||||||||||
| 292 | 1 | ▶ | 'create-ackrc' => sub { say for ( '--ignore-ack-defaults', App::Ack::ConfigDefault::options() ); exit; }, | ||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=2 SCAR=6.9
| |||||||||||||||||||||||||||||||||||||||||
| 293 | 'debug' => \$opt->{debug}, | ||||||||||||||||||||||||||||||||||||||||
| 294 | 9 | ▶ | 'env!' => sub { | ||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=2 SCAR=6.9
| |||||||||||||||||||||||||||||||||||||||||
| 295 | 9 | my ( undef, $value ) = @_; | |||||||||||||||||||||||||||||||||||||||
| 296 | |||||||||||||||||||||||||||||||||||||||||
| 297 | 9 | ▶ | if ( !$value ) { | ||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||
| 298 | 1 | $opt->{noenv_seen} = 1; | |||||||||||||||||||||||||||||||||||||||
| 299 | } | ||||||||||||||||||||||||||||||||||||||||
| 300 | }, | ||||||||||||||||||||||||||||||||||||||||
| 301 | f => \$opt->{f}, | ||||||||||||||||||||||||||||||||||||||||
| 302 | 'files-from=s' => \$opt->{files_from}, | ||||||||||||||||||||||||||||||||||||||||
| 303 | 'filter!' => \$App::Ack::is_filter_mode, | ||||||||||||||||||||||||||||||||||||||||
| 304 | 0 | ▶ | flush => sub { $| = 1 }, | ||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||||||||||||||
| 305 | 'follow!' => \$opt->{follow}, | ||||||||||||||||||||||||||||||||||||||||
| 306 | g => \$opt->{g}, | ||||||||||||||||||||||||||||||||||||||||
| 307 | 31 | ▶ | 'group!' => sub { shift; $opt->{heading} = $opt->{break} = shift }, | ||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||
| 308 | 'heading!' => \$opt->{heading}, | ||||||||||||||||||||||||||||||||||||||||
| 309 | 'h|no-filename' => \$opt->{h}, | ||||||||||||||||||||||||||||||||||||||||
| 310 | 'H|with-filename' => \$opt->{H}, | ||||||||||||||||||||||||||||||||||||||||
| 311 | 77 | ▶ | 'i|ignore-case' => sub { $opt->{i} = 1; $opt->{S} = 0; }, | ||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||
| 312 | 0 | ▶ | 'I|no-ignore-case' => sub { $opt->{i} = 0; $opt->{S} = 0; }, | ||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||||||||||||||
| 313 | 'ignore-directory|ignore-dir=s' => _generate_ignore_dir('--ignore-dir', $opt), | ||||||||||||||||||||||||||||||||||||||||
| 314 | 7767 | ▶ | 'ignore-file=s' => sub { | ||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=3 SCAR=11.0
| |||||||||||||||||||||||||||||||||||||||||
| 315 | 7767 | my ( undef, $file ) = @_; | |||||||||||||||||||||||||||||||||||||||
| 316 | |||||||||||||||||||||||||||||||||||||||||
| 317 | 7767 | my ( $filter_type, $args ) = split /:/, $file, 2; | |||||||||||||||||||||||||||||||||||||||
| 318 | |||||||||||||||||||||||||||||||||||||||||
| 319 | 7767 | ▶ | my $filter = App::Ack::Filter->create_filter($filter_type, split(/,/, $args//'')); | ||||||||||||||||||||||||||||||||||||||
|
Condition100%2/2
$args // ""
MC/DC100%1/1
$args // ""
$args
Truth table100%2/2
A
A= $args
| |||||||||||||||||||||||||||||||||||||||||
| 320 | |||||||||||||||||||||||||||||||||||||||||
| 321 | 7765 | ▶ | if ( !$opt->{ifiles} ) { | ||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||
| 322 | 388 | $opt->{ifiles} = App::Ack::Filter::Collection->new(); | |||||||||||||||||||||||||||||||||||||||
| 323 | } | ||||||||||||||||||||||||||||||||||||||||
| 324 | 7765 | $opt->{ifiles}->add($filter); | |||||||||||||||||||||||||||||||||||||||
| 325 | }, | ||||||||||||||||||||||||||||||||||||||||
| 326 | 'l|files-with-matches' | ||||||||||||||||||||||||||||||||||||||||
| 327 | => \$opt->{l}, | ||||||||||||||||||||||||||||||||||||||||
| 328 | 'L|files-without-matches' | ||||||||||||||||||||||||||||||||||||||||
| 329 | => \$opt->{L}, | ||||||||||||||||||||||||||||||||||||||||
| 330 | 'm|max-count=i' => \$opt->{m}, | ||||||||||||||||||||||||||||||||||||||||
| 331 | 'match=s' => \$opt->{regex}, | ||||||||||||||||||||||||||||||||||||||||
| 332 | 'n|no-recurse' => \$opt->{n}, | ||||||||||||||||||||||||||||||||||||||||
| 333 | 0 | ▶ | o => sub { $opt->{output} = '$&' }, | ||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||||||||||||||
| 334 | 'output=s' => \$opt->{output}, | ||||||||||||||||||||||||||||||||||||||||
| 335 | 6 | ▶ | 'pager:s' => sub { | ||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=2 SCAR=7.1
| |||||||||||||||||||||||||||||||||||||||||
| 336 | 6 | my ( undef, $value ) = @_; | |||||||||||||||||||||||||||||||||||||||
| 337 | |||||||||||||||||||||||||||||||||||||||||
| 338 | 6 | ▶ | $opt->{pager} = $value || $ENV{PAGER}; | ||||||||||||||||||||||||||||||||||||||
|
Condition66%2/3
$value || $ENV{'PAGER'}
MC/DC0%0/2
$value || $ENV{'PAGER'}
$value
$ENV{'PAGER'}
Truth table66%2/3
A || B
A= $valueB= $ENV{'PAGER'}
| |||||||||||||||||||||||||||||||||||||||||
| 339 | }, | ||||||||||||||||||||||||||||||||||||||||
| 340 | 'noignore-directory|noignore-dir=s' => _generate_ignore_dir('--noignore-dir', $opt), | ||||||||||||||||||||||||||||||||||||||||
| 341 | 3 | ▶ | 'nopager' => sub { $opt->{pager} = undef }, | ||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||
| 342 | 'not=s' => $opt->{not}, | ||||||||||||||||||||||||||||||||||||||||
| 343 | 'or=s' => $opt->{or}, | ||||||||||||||||||||||||||||||||||||||||
| 344 | 'passthru' => \$opt->{passthru}, | ||||||||||||||||||||||||||||||||||||||||
| 345 | 'print0' => \$opt->{print0}, | ||||||||||||||||||||||||||||||||||||||||
| 346 | 'p|proximate:1' => \$opt->{p}, | ||||||||||||||||||||||||||||||||||||||||
| 347 | 0 | ▶ | 'P' => sub { $opt->{p} = 0 }, | ||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||||||||||||||
| 348 | 'Q|literal' => \$opt->{Q}, | ||||||||||||||||||||||||||||||||||||||||
| 349 | 3 | ▶ | 'r|R|recurse' => sub { $opt->{n} = 0 }, | ||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||
| 350 | 'range-start=s' => \$opt->{range_start}, | ||||||||||||||||||||||||||||||||||||||||
| 351 | 'range-end=s' => \$opt->{range_end}, | ||||||||||||||||||||||||||||||||||||||||
| 352 | 'range-invert!' => \$opt->{range_invert}, | ||||||||||||||||||||||||||||||||||||||||
| 353 | 's' => \$opt->{s}, | ||||||||||||||||||||||||||||||||||||||||
| 354 | 'show-types' => \$opt->{show_types}, | ||||||||||||||||||||||||||||||||||||||||
| 355 | 15 | ▶ | 'S|smart-case!' => sub { my (undef,$value) = @_; $opt->{S} = $value; $opt->{i} = 0 if $value; }, | ||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=2 SCAR=7.1
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||
| 356 | 'sort-files' => \$opt->{sort_files}, | ||||||||||||||||||||||||||||||||||||||||
| 357 | 't|type=s' => \&_type_handler, | ||||||||||||||||||||||||||||||||||||||||
| 358 | 1 | ▶ | 'T=s' => sub { my ($getopt,$value) = @_; $value="no$value"; _type_handler($getopt,$value); }, | ||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||
| 359 | 'underline!' => \$opt->{underline}, | ||||||||||||||||||||||||||||||||||||||||
| 360 | 'v|invert-match' => \$opt->{v}, | ||||||||||||||||||||||||||||||||||||||||
| 361 | 'w|word-regexp' => \$opt->{w}, | ||||||||||||||||||||||||||||||||||||||||
| 362 | 3 | ▶ | 'x' => sub { $opt->{files_from} = '-' }, | ||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||
| 363 | |||||||||||||||||||||||||||||||||||||||||
| 364 | 0 | ▶ | 'help' => sub { App::Ack::show_help(); exit; }, | ||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||||||||||||||
| 365 | 5 | ▶ | 'help-types' => sub { App::Ack::show_help_types(); exit; }, | ||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||
| 366 | 0 | ▶ | 'help-colors' => sub { App::Ack::show_help_colors(); exit; }, | ||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||||||||||||||
| 367 | 0 | ▶ | 'help-rgb-colors' => sub { App::Ack::show_help_rgb(); exit; }, | ||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||||||||||||||
| 368 | 1030 | ▶ | $extra_specs ? %{$extra_specs} : (), | ||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||
| 369 | }; # arg_specs | ||||||||||||||||||||||||||||||||||||||||
| 370 | } | ||||||||||||||||||||||||||||||||||||||||
| 371 | |||||||||||||||||||||||||||||||||||||||||
| 372 | |||||||||||||||||||||||||||||||||||||||||
| 373 | 42 | ▶ | sub _context_value { | ||||||||||||||||||||||||||||||||||||||
|
Subroutine
_context_value: called CC=4 SCAR=13.9
| |||||||||||||||||||||||||||||||||||||||||
| 374 | 42 | my $val = shift; | |||||||||||||||||||||||||||||||||||||||
| 375 | |||||||||||||||||||||||||||||||||||||||||
| 376 | # Contexts default to 2. | ||||||||||||||||||||||||||||||||||||||||
| 377 | 42 | ▶ | return 2 if !defined($val) || $val < 0; | ||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
not defined $val or $val < 0
MC/DC50%1/2
not defined $val or $val < 0
not defined $val
$val < 0
Truth table66%2/3
not(A) or B
A= not defined $valB= $val < 0
| |||||||||||||||||||||||||||||||||||||||||
| 378 | |||||||||||||||||||||||||||||||||||||||||
| 379 | 22 | ▶ | if ( $val > 10_000 ) { | ||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||
| 380 | 1 | App::Ack::die( | |||||||||||||||||||||||||||||||||||||||
| 381 | "Context value $val exceeds the maximum allowed " | ||||||||||||||||||||||||||||||||||||||||
| 382 | . "value of 10000." | ||||||||||||||||||||||||||||||||||||||||
| 383 | ); | ||||||||||||||||||||||||||||||||||||||||
| 384 | } | ||||||||||||||||||||||||||||||||||||||||
| 385 | |||||||||||||||||||||||||||||||||||||||||
| 386 | 21 | return $val; | |||||||||||||||||||||||||||||||||||||||
| 387 | } | ||||||||||||||||||||||||||||||||||||||||
| 388 | |||||||||||||||||||||||||||||||||||||||||
| 389 | |||||||||||||||||||||||||||||||||||||||||
| 390 | 426 | ▶ | sub _process_other { | ||||||||||||||||||||||||||||||||||||||
|
Subroutine
_process_other: called CC=12 SCAR=24.9
| |||||||||||||||||||||||||||||||||||||||||
| 391 | 426 | my ( $opt, $extra_specs, $arg_sources ) = @_; | |||||||||||||||||||||||||||||||||||||||
| 392 | |||||||||||||||||||||||||||||||||||||||||
| 393 | 426 | my $argv_source; | |||||||||||||||||||||||||||||||||||||||
| 394 | my $is_help_types_active; | ||||||||||||||||||||||||||||||||||||||||
| 395 | |||||||||||||||||||||||||||||||||||||||||
| 396 | 426 | foreach my $source (@{$arg_sources}) { | |||||||||||||||||||||||||||||||||||||||
| 397 | 825 | ▶ | if ( $source->{name} eq 'ARGV' ) { | ||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||
| 398 | 426 | $argv_source = $source->{contents}; | |||||||||||||||||||||||||||||||||||||||
| 399 | 426 | last; | |||||||||||||||||||||||||||||||||||||||
| 400 | } | ||||||||||||||||||||||||||||||||||||||||
| 401 | } | ||||||||||||||||||||||||||||||||||||||||
| 402 | |||||||||||||||||||||||||||||||||||||||||
| 403 | 426 | ▶ | if ( $argv_source ) { # This *should* always be true, but you never know... | ||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||
| 404 | 426 | configure_parser( 'pass_through' ); | |||||||||||||||||||||||||||||||||||||||
| 405 | 426 | Getopt::Long::GetOptionsFromArray( [ @{$argv_source} ], | |||||||||||||||||||||||||||||||||||||||
| 406 | 'help-types' => \$is_help_types_active, | ||||||||||||||||||||||||||||||||||||||||
| 407 | ); | ||||||||||||||||||||||||||||||||||||||||
| 408 | } | ||||||||||||||||||||||||||||||||||||||||
| 409 | |||||||||||||||||||||||||||||||||||||||||
| 410 | 426 | my $arg_specs = get_arg_spec( $opt, $extra_specs ); | |||||||||||||||||||||||||||||||||||||||
| 411 | |||||||||||||||||||||||||||||||||||||||||
| 412 | 426 | configure_parser(); | |||||||||||||||||||||||||||||||||||||||
| 413 | 426 | foreach my $source (@{$arg_sources}) { | |||||||||||||||||||||||||||||||||||||||
| 414 | 818 | my ( $source_name, $args ) = @{$source}{qw/name contents/}; | |||||||||||||||||||||||||||||||||||||||
| 415 | |||||||||||||||||||||||||||||||||||||||||
| 416 | 818 | my $args_for_source = { %{$arg_specs} }; | |||||||||||||||||||||||||||||||||||||||
| 417 | |||||||||||||||||||||||||||||||||||||||||
| 418 | 818 | ▶ | if ( $source->{is_ackrc} ) { | ||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||
| 419 | 4 | ▶ | my $illegal = sub { | ||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||
| 420 | 4 | my $name = shift; | |||||||||||||||||||||||||||||||||||||||
| 421 | 4 | App::Ack::die( "Option --$name is forbidden in .ackrc files." ); | |||||||||||||||||||||||||||||||||||||||
| 422 | 13 | }; | |||||||||||||||||||||||||||||||||||||||
| 423 | |||||||||||||||||||||||||||||||||||||||||
| 424 | $args_for_source = { | ||||||||||||||||||||||||||||||||||||||||
| 425 | 13 | %{$args_for_source}, | |||||||||||||||||||||||||||||||||||||||
| 426 | 'output=s' => $illegal, | ||||||||||||||||||||||||||||||||||||||||
| 427 | 'match=s' => $illegal, | ||||||||||||||||||||||||||||||||||||||||
| 428 | }; | ||||||||||||||||||||||||||||||||||||||||
| 429 | } | ||||||||||||||||||||||||||||||||||||||||
| 430 | 818 | ▶ | if ( $source->{project} ) { | ||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||
| 431 | 2 | ▶ | my $illegal = sub { | ||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||
| 432 | 2 | my $name = shift; | |||||||||||||||||||||||||||||||||||||||
| 433 | 2 | App::Ack::die( "Option --$name is forbidden in project .ackrc files." ); | |||||||||||||||||||||||||||||||||||||||
| 434 | 6 | }; | |||||||||||||||||||||||||||||||||||||||
| 435 | |||||||||||||||||||||||||||||||||||||||||
| 436 | $args_for_source = { | ||||||||||||||||||||||||||||||||||||||||
| 437 | 6 | %{$args_for_source}, | |||||||||||||||||||||||||||||||||||||||
| 438 | 'pager:s' => $illegal, | ||||||||||||||||||||||||||||||||||||||||
| 439 | 'follow!' => $illegal, | ||||||||||||||||||||||||||||||||||||||||
| 440 | }; | ||||||||||||||||||||||||||||||||||||||||
| 441 | } | ||||||||||||||||||||||||||||||||||||||||
| 442 | |||||||||||||||||||||||||||||||||||||||||
| 443 | 818 | my $ret; | |||||||||||||||||||||||||||||||||||||||
| 444 | 818 | ▶ | if ( ref($args) ) { | ||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||
| 445 | 818 | $ret = Getopt::Long::GetOptionsFromArray( $args, %{$args_for_source} ); | |||||||||||||||||||||||||||||||||||||||
| 446 | } | ||||||||||||||||||||||||||||||||||||||||
| 447 | else { | ||||||||||||||||||||||||||||||||||||||||
| 448 | ( $ret, $source->{contents} ) = | ||||||||||||||||||||||||||||||||||||||||
| 449 | 0 | Getopt::Long::GetOptionsFromString( $args, %{$args_for_source} ); | |||||||||||||||||||||||||||||||||||||||
| 450 | } | ||||||||||||||||||||||||||||||||||||||||
| 451 | 812 | ▶ | if ( !$ret ) { | ||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||
| 452 | 16 | ▶ | if ( !$is_help_types_active ) { | ||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||
| 453 | 15 | ▶ | my $where = $source_name eq 'ARGV' ? 'on command line' : "in $source_name"; | ||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||
| 454 | 15 | App::Ack::die( "Invalid option $where" ); | |||||||||||||||||||||||||||||||||||||||
| 455 | } | ||||||||||||||||||||||||||||||||||||||||
| 456 | } | ||||||||||||||||||||||||||||||||||||||||
| 457 | 797 | ▶ | if ( $opt->{noenv_seen} ) { | ||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||
| 458 | 1 | App::Ack::die( "--noenv found in $source_name" ); | |||||||||||||||||||||||||||||||||||||||
| 459 | } | ||||||||||||||||||||||||||||||||||||||||
| 460 | } | ||||||||||||||||||||||||||||||||||||||||
| 461 | |||||||||||||||||||||||||||||||||||||||||
| 462 | # XXX We need to check on a -- in the middle of a non-ARGV source | ||||||||||||||||||||||||||||||||||||||||
| 463 | |||||||||||||||||||||||||||||||||||||||||
| 464 | 404 | return; | |||||||||||||||||||||||||||||||||||||||
| 465 | } | ||||||||||||||||||||||||||||||||||||||||
| 466 | |||||||||||||||||||||||||||||||||||||||||
| 467 | |||||||||||||||||||||||||||||||||||||||||
| 468 | 2 | ▶ | sub _explode_sources { | ||||||||||||||||||||||||||||||||||||||
|
Subroutine
_explode_sources: called CC=7 SCAR=19.6
| |||||||||||||||||||||||||||||||||||||||||
| 469 | 2 | my ( $sources ) = @_; | |||||||||||||||||||||||||||||||||||||||
| 470 | |||||||||||||||||||||||||||||||||||||||||
| 471 | 2 | my @new_sources; | |||||||||||||||||||||||||||||||||||||||
| 472 | |||||||||||||||||||||||||||||||||||||||||
| 473 | my %opt; | ||||||||||||||||||||||||||||||||||||||||
| 474 | 2 | my $arg_spec = get_arg_spec( \%opt, {} ); | |||||||||||||||||||||||||||||||||||||||
| 475 | |||||||||||||||||||||||||||||||||||||||||
| 476 | 2 | ▶ | my $dummy_sub = sub {}; | ||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||
| 477 | 202 | ▶ | my $add_type = sub { | ||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=2 SCAR=6.9
| |||||||||||||||||||||||||||||||||||||||||
| 478 | 202 | my ( undef, $arg ) = @_; | |||||||||||||||||||||||||||||||||||||||
| 479 | |||||||||||||||||||||||||||||||||||||||||
| 480 | 202 | ▶ | if ( $arg =~ /(\w+)=/) { | ||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||
| 481 | 2 | $arg_spec->{$1} = $dummy_sub; | |||||||||||||||||||||||||||||||||||||||
| 482 | } | ||||||||||||||||||||||||||||||||||||||||
| 483 | else { | ||||||||||||||||||||||||||||||||||||||||
| 484 | 200 | ( $arg ) = split /:/, $arg; | |||||||||||||||||||||||||||||||||||||||
| 485 | 200 | $arg_spec->{$arg} = $dummy_sub; | |||||||||||||||||||||||||||||||||||||||
| 486 | } | ||||||||||||||||||||||||||||||||||||||||
| 487 | 2 | }; | |||||||||||||||||||||||||||||||||||||||
| 488 | |||||||||||||||||||||||||||||||||||||||||
| 489 | 2 | ▶ | my $del_type = sub { | ||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||
| 490 | 2 | my ( undef, $arg ) = @_; | |||||||||||||||||||||||||||||||||||||||
| 491 | |||||||||||||||||||||||||||||||||||||||||
| 492 | 2 | delete $arg_spec->{$arg}; | |||||||||||||||||||||||||||||||||||||||
| 493 | 2 | }; | |||||||||||||||||||||||||||||||||||||||
| 494 | |||||||||||||||||||||||||||||||||||||||||
| 495 | 2 | configure_parser( 'pass_through' ); | |||||||||||||||||||||||||||||||||||||||
| 496 | 2 | foreach my $source (@{$sources}) { | |||||||||||||||||||||||||||||||||||||||
| 497 | 4 | my ( $name, $options ) = @{$source}{qw/name contents/}; | |||||||||||||||||||||||||||||||||||||||
| 498 | 4 | ▶ | if ( ref($options) ne 'ARRAY' ) { | ||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||
| 499 | 0 | $source->{contents} = $options = | |||||||||||||||||||||||||||||||||||||||
| 500 | [ Text::ParseWords::shellwords($options) ]; | ||||||||||||||||||||||||||||||||||||||||
| 501 | } | ||||||||||||||||||||||||||||||||||||||||
| 502 | |||||||||||||||||||||||||||||||||||||||||
| 503 | 4 | for my $j ( 0 .. @{$options}-1 ) { | |||||||||||||||||||||||||||||||||||||||
| 504 | 300 | ▶ | next unless $options->[$j] =~ /^-/; | ||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||
| 505 | 300 | my @chunk = ( $options->[$j] ); | |||||||||||||||||||||||||||||||||||||||
| 506 | 300 | ▶ | push @chunk, $options->[$j] while ++$j < @{$options} && $options->[$j] !~ /^-/; | ||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
++$j < @{$options;} and not $options->[$j] =~ /^-/
MC/DC0%0/2
++$j < @{$options;} and not $options->[$j] =~ /^-/
++$j < @{$options;}
not $options->[$j] =~ /^-/
Truth table66%2/3
A and not(B)
A= ++$j < @{$options;}B= not $options->[$j] =~ /^-/
| |||||||||||||||||||||||||||||||||||||||||
| 507 | 300 | $j--; | |||||||||||||||||||||||||||||||||||||||
| 508 | |||||||||||||||||||||||||||||||||||||||||
| 509 | 300 | my @copy = @chunk; | |||||||||||||||||||||||||||||||||||||||
| 510 | Getopt::Long::GetOptionsFromArray( [@chunk], | ||||||||||||||||||||||||||||||||||||||||
| 511 | 'type-add=s' => $add_type, | ||||||||||||||||||||||||||||||||||||||||
| 512 | 'type-set=s' => $add_type, | ||||||||||||||||||||||||||||||||||||||||
| 513 | 'type-del=s' => $del_type, | ||||||||||||||||||||||||||||||||||||||||
| 514 | 300 | %{$arg_spec} | |||||||||||||||||||||||||||||||||||||||
| 515 | ); | ||||||||||||||||||||||||||||||||||||||||
| 516 | |||||||||||||||||||||||||||||||||||||||||
| 517 | 300 | push @new_sources, { | |||||||||||||||||||||||||||||||||||||||
| 518 | name => $name, | ||||||||||||||||||||||||||||||||||||||||
| 519 | contents => \@copy, | ||||||||||||||||||||||||||||||||||||||||
| 520 | }; | ||||||||||||||||||||||||||||||||||||||||
| 521 | } | ||||||||||||||||||||||||||||||||||||||||
| 522 | } | ||||||||||||||||||||||||||||||||||||||||
| 523 | |||||||||||||||||||||||||||||||||||||||||
| 524 | 2 | return \@new_sources; | |||||||||||||||||||||||||||||||||||||||
| 525 | } | ||||||||||||||||||||||||||||||||||||||||
| 526 | |||||||||||||||||||||||||||||||||||||||||
| 527 | |||||||||||||||||||||||||||||||||||||||||
| 528 | 1051 | ▶ | sub _compare_opts { | ||||||||||||||||||||||||||||||||||||||
|
Subroutine
_compare_opts: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||
| 529 | 1051 | my ( $a, $b ) = @_; | |||||||||||||||||||||||||||||||||||||||
| 530 | |||||||||||||||||||||||||||||||||||||||||
| 531 | 1051 | my $first_a = $a->[0]; | |||||||||||||||||||||||||||||||||||||||
| 532 | 1051 | my $first_b = $b->[0]; | |||||||||||||||||||||||||||||||||||||||
| 533 | |||||||||||||||||||||||||||||||||||||||||
| 534 | 1051 | $first_a =~ s/^--?//; | |||||||||||||||||||||||||||||||||||||||
| 535 | 1051 | $first_b =~ s/^--?//; | |||||||||||||||||||||||||||||||||||||||
| 536 | |||||||||||||||||||||||||||||||||||||||||
| 537 | 1051 | return $first_a cmp $first_b; | |||||||||||||||||||||||||||||||||||||||
| 538 | } | ||||||||||||||||||||||||||||||||||||||||
| 539 | |||||||||||||||||||||||||||||||||||||||||
| 540 | |||||||||||||||||||||||||||||||||||||||||
| 541 | 2 | ▶ | sub _dump_options { | ||||||||||||||||||||||||||||||||||||||
|
Subroutine
_dump_options: called CC=5 SCAR=16.1
| |||||||||||||||||||||||||||||||||||||||||
| 542 | 2 | my ( $sources ) = @_; | |||||||||||||||||||||||||||||||||||||||
| 543 | |||||||||||||||||||||||||||||||||||||||||
| 544 | 2 | $sources = _explode_sources($sources); | |||||||||||||||||||||||||||||||||||||||
| 545 | |||||||||||||||||||||||||||||||||||||||||
| 546 | 2 | my %opts_by_source; | |||||||||||||||||||||||||||||||||||||||
| 547 | my @source_names; | ||||||||||||||||||||||||||||||||||||||||
| 548 | |||||||||||||||||||||||||||||||||||||||||
| 549 | 2 | foreach my $source (@{$sources}) { | |||||||||||||||||||||||||||||||||||||||
| 550 | 300 | my $name = $source->{name}; | |||||||||||||||||||||||||||||||||||||||
| 551 | 300 | ▶ | if ( not $opts_by_source{$name} ) { | ||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||
| 552 | 3 | $opts_by_source{$name} = []; | |||||||||||||||||||||||||||||||||||||||
| 553 | 3 | push @source_names, $name; | |||||||||||||||||||||||||||||||||||||||
| 554 | } | ||||||||||||||||||||||||||||||||||||||||
| 555 | 300 | push @{$opts_by_source{$name}}, $source->{contents}; | |||||||||||||||||||||||||||||||||||||||
| 556 | } | ||||||||||||||||||||||||||||||||||||||||
| 557 | |||||||||||||||||||||||||||||||||||||||||
| 558 | 2 | foreach my $name (@source_names) { | |||||||||||||||||||||||||||||||||||||||
| 559 | 3 | my $contents = $opts_by_source{$name}; | |||||||||||||||||||||||||||||||||||||||
| 560 | |||||||||||||||||||||||||||||||||||||||||
| 561 | 3 | say $name; | |||||||||||||||||||||||||||||||||||||||
| 562 | 3 | say '=' x length($name); | |||||||||||||||||||||||||||||||||||||||
| 563 | 3 | say ' ', join(' ', @{$_}) for sort { _compare_opts($a, $b) } @{$contents}; | |||||||||||||||||||||||||||||||||||||||
| 564 | } | ||||||||||||||||||||||||||||||||||||||||
| 565 | |||||||||||||||||||||||||||||||||||||||||
| 566 | 2 | return; | |||||||||||||||||||||||||||||||||||||||
| 567 | } | ||||||||||||||||||||||||||||||||||||||||
| 568 | |||||||||||||||||||||||||||||||||||||||||
| 569 | |||||||||||||||||||||||||||||||||||||||||
| 570 | 604 | ▶ | sub _remove_default_options_if_needed { | ||||||||||||||||||||||||||||||||||||||
|
Subroutine
_remove_default_options_if_needed: called CC=7 SCAR=19.5
| |||||||||||||||||||||||||||||||||||||||||
| 571 | 604 | my ( $sources ) = @_; | |||||||||||||||||||||||||||||||||||||||
| 572 | |||||||||||||||||||||||||||||||||||||||||
| 573 | 604 | my $default_index; | |||||||||||||||||||||||||||||||||||||||
| 574 | |||||||||||||||||||||||||||||||||||||||||
| 575 | 604 | foreach my $index ( 0 .. $#{$sources} ) { | |||||||||||||||||||||||||||||||||||||||
| 576 | 604 | ▶ | if ( $sources->[$index]{'name'} eq 'Defaults' ) { | ||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||
| 577 | 567 | $default_index = $index; | |||||||||||||||||||||||||||||||||||||||
| 578 | 567 | last; | |||||||||||||||||||||||||||||||||||||||
| 579 | } | ||||||||||||||||||||||||||||||||||||||||
| 580 | } | ||||||||||||||||||||||||||||||||||||||||
| 581 | |||||||||||||||||||||||||||||||||||||||||
| 582 | 604 | ▶ | return $sources unless defined $default_index; | ||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||
| 583 | |||||||||||||||||||||||||||||||||||||||||
| 584 | 567 | my $should_remove = 0; | |||||||||||||||||||||||||||||||||||||||
| 585 | |||||||||||||||||||||||||||||||||||||||||
| 586 | 567 | configure_parser( 'no_auto_abbrev', 'pass_through' ); | |||||||||||||||||||||||||||||||||||||||
| 587 | |||||||||||||||||||||||||||||||||||||||||
| 588 | 567 | foreach my $index ( $default_index + 1 .. $#{$sources} ) { | |||||||||||||||||||||||||||||||||||||||
| 589 | 580 | my $args = $sources->[$index]->{contents}; | |||||||||||||||||||||||||||||||||||||||
| 590 | |||||||||||||||||||||||||||||||||||||||||
| 591 | 580 | ▶ | if (ref($args)) { | ||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||
| 592 | 580 | Getopt::Long::GetOptionsFromArray( $args, | |||||||||||||||||||||||||||||||||||||||
| 593 | 'ignore-ack-defaults' => \$should_remove, | ||||||||||||||||||||||||||||||||||||||||
| 594 | ); | ||||||||||||||||||||||||||||||||||||||||
| 595 | } | ||||||||||||||||||||||||||||||||||||||||
| 596 | else { | ||||||||||||||||||||||||||||||||||||||||
| 597 | 0 | ( undef, $sources->[$index]{contents} ) = Getopt::Long::GetOptionsFromString( $args, | |||||||||||||||||||||||||||||||||||||||
| 598 | 'ignore-ack-defaults' => \$should_remove, | ||||||||||||||||||||||||||||||||||||||||
| 599 | ); | ||||||||||||||||||||||||||||||||||||||||
| 600 | } | ||||||||||||||||||||||||||||||||||||||||
| 601 | } | ||||||||||||||||||||||||||||||||||||||||
| 602 | |||||||||||||||||||||||||||||||||||||||||
| 603 | 567 | ▶ | return $sources unless $should_remove; | ||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||
| 604 | |||||||||||||||||||||||||||||||||||||||||
| 605 | 3 | my @copy = @{$sources}; | |||||||||||||||||||||||||||||||||||||||
| 606 | 3 | splice @copy, $default_index, 1; | |||||||||||||||||||||||||||||||||||||||
| 607 | 3 | return \@copy; | |||||||||||||||||||||||||||||||||||||||
| 608 | } | ||||||||||||||||||||||||||||||||||||||||
| 609 | |||||||||||||||||||||||||||||||||||||||||
| 610 | |||||||||||||||||||||||||||||||||||||||||
| 611 | 604 | ▶ | sub process_args { | ||||||||||||||||||||||||||||||||||||||
|
Subroutine
process_args: called CC=11 SCAR=24.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||
| 612 | 604 | my $arg_sources = \@_; | |||||||||||||||||||||||||||||||||||||||
| 613 | |||||||||||||||||||||||||||||||||||||||||
| 614 | my %opt = ( | ||||||||||||||||||||||||||||||||||||||||
| 615 | pager => $ENV{ACK_PAGER_COLOR} || $ENV{ACK_PAGER}, | ||||||||||||||||||||||||||||||||||||||||
| 616 | 604 | ▶ | ); | ||||||||||||||||||||||||||||||||||||||
|
Condition100%3/3
$ENV{'ACK_PAGER_COLOR'} || $ENV{'ACK_PAGER'}
MC/DC100%2/2
$ENV{'ACK_PAGER_COLOR'} || $ENV{'ACK_PAGER'}
$ENV{'ACK_PAGER_COLOR'}
$ENV{'ACK_PAGER'}
Truth table100%3/3
A || B
A= $ENV{'ACK_PAGER_COLOR'}B= $ENV{'ACK_PAGER'}
| |||||||||||||||||||||||||||||||||||||||||
| 617 | |||||||||||||||||||||||||||||||||||||||||
| 618 | 604 | $arg_sources = _remove_default_options_if_needed($arg_sources); | |||||||||||||||||||||||||||||||||||||||
| 619 | |||||||||||||||||||||||||||||||||||||||||
| 620 | # Check for --dump early. | ||||||||||||||||||||||||||||||||||||||||
| 621 | 604 | foreach my $source (@{$arg_sources}) { | |||||||||||||||||||||||||||||||||||||||
| 622 | 1181 | ▶ | if ( $source->{name} eq 'ARGV' ) { | ||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||
| 623 | 604 | my $dump; | |||||||||||||||||||||||||||||||||||||||
| 624 | 604 | configure_parser( 'pass_through' ); | |||||||||||||||||||||||||||||||||||||||
| 625 | Getopt::Long::GetOptionsFromArray( $source->{contents}, | ||||||||||||||||||||||||||||||||||||||||
| 626 | 604 | 'dump' => \$dump, | |||||||||||||||||||||||||||||||||||||||
| 627 | ); | ||||||||||||||||||||||||||||||||||||||||
| 628 | 604 | ▶ | if ( $dump ) { | ||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||
| 629 | 2 | _dump_options($arg_sources); | |||||||||||||||||||||||||||||||||||||||
| 630 | 2 | exit(0); | |||||||||||||||||||||||||||||||||||||||
| 631 | } | ||||||||||||||||||||||||||||||||||||||||
| 632 | } | ||||||||||||||||||||||||||||||||||||||||
| 633 | } | ||||||||||||||||||||||||||||||||||||||||
| 634 | |||||||||||||||||||||||||||||||||||||||||
| 635 | 602 | my $type_specs = _process_filetypes(\%opt, $arg_sources); | |||||||||||||||||||||||||||||||||||||||
| 636 | |||||||||||||||||||||||||||||||||||||||||
| 637 | 602 | _check_for_mutex_options( $type_specs ); | |||||||||||||||||||||||||||||||||||||||
| 638 | |||||||||||||||||||||||||||||||||||||||||
| 639 | 426 | _process_other(\%opt, $type_specs, $arg_sources); | |||||||||||||||||||||||||||||||||||||||
| 640 | 404 | ▶ | while ( @{$arg_sources} ) { | ||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||
| 641 | 775 | my $source = shift @{$arg_sources}; | |||||||||||||||||||||||||||||||||||||||
| 642 | 775 | my $args = $source->{contents}; | |||||||||||||||||||||||||||||||||||||||
| 643 | |||||||||||||||||||||||||||||||||||||||||
| 644 | # All of our sources should be transformed into an array ref | ||||||||||||||||||||||||||||||||||||||||
| 645 | 775 | ▶ | if ( ref($args) ) { | ||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||
| 646 | 775 | my $source_name = $source->{name}; | |||||||||||||||||||||||||||||||||||||||
| 647 | 775 | ▶ | if ( $source_name eq 'ARGV' ) { | ||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||
| 648 | 404 | @ARGV = @{$args}; | |||||||||||||||||||||||||||||||||||||||
| 649 | } | ||||||||||||||||||||||||||||||||||||||||
| 650 | 371 | elsif (@{$args}) { | |||||||||||||||||||||||||||||||||||||||
| 651 | 0 | App::Ack::die( "Source '$source_name' has extra arguments!" ); | |||||||||||||||||||||||||||||||||||||||
| 652 | } | ||||||||||||||||||||||||||||||||||||||||
| 653 | } | ||||||||||||||||||||||||||||||||||||||||
| 654 | else { | ||||||||||||||||||||||||||||||||||||||||
| 655 | 0 | App::Ack::die( 'The impossible has occurred!' ); | |||||||||||||||||||||||||||||||||||||||
| 656 | } | ||||||||||||||||||||||||||||||||||||||||
| 657 | } | ||||||||||||||||||||||||||||||||||||||||
| 658 | 404 | ▶ | my $filters = ($opt{filters} ||= []); | ||||||||||||||||||||||||||||||||||||||
|
Condition100%2/2
$opt{"filters"} ||= []
MC/DC100%1/1
$opt{"filters"} ||= []
$opt{"filters"}
Truth table100%2/2
A
A= $opt{"filters"}
| |||||||||||||||||||||||||||||||||||||||||
| 659 | |||||||||||||||||||||||||||||||||||||||||
| 660 | # Throw the default filter in if no others are selected. | ||||||||||||||||||||||||||||||||||||||||
| 661 | 404 | ▶ | if ( not grep { !$_->is_inverted() } @{$filters} ) { | ||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||
| 662 | 310 | push @{$filters}, App::Ack::Filter::Default->new(); | |||||||||||||||||||||||||||||||||||||||
| 663 | } | ||||||||||||||||||||||||||||||||||||||||
| 664 | 404 | return \%opt; | |||||||||||||||||||||||||||||||||||||||
| 665 | } | ||||||||||||||||||||||||||||||||||||||||
| 666 | |||||||||||||||||||||||||||||||||||||||||
| 667 | |||||||||||||||||||||||||||||||||||||||||
| 668 | 570 | ▶ | sub retrieve_arg_sources { | ||||||||||||||||||||||||||||||||||||||
|
Subroutine
retrieve_arg_sources: called CC=6 SCAR=17.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||
| 669 | 570 | my @arg_sources; | |||||||||||||||||||||||||||||||||||||||
| 670 | |||||||||||||||||||||||||||||||||||||||||
| 671 | my $noenv; | ||||||||||||||||||||||||||||||||||||||||
| 672 | 570 | my $ackrc; | |||||||||||||||||||||||||||||||||||||||
| 673 | |||||||||||||||||||||||||||||||||||||||||
| 674 | 570 | configure_parser( 'no_auto_abbrev', 'pass_through' ); | |||||||||||||||||||||||||||||||||||||||
| 675 | 570 | Getopt::Long::GetOptions( | |||||||||||||||||||||||||||||||||||||||
| 676 | 'noenv' => \$noenv, | ||||||||||||||||||||||||||||||||||||||||
| 677 | 'ackrc=s' => \$ackrc, | ||||||||||||||||||||||||||||||||||||||||
| 678 | ); | ||||||||||||||||||||||||||||||||||||||||
| 679 | |||||||||||||||||||||||||||||||||||||||||
| 680 | 570 | my @files; | |||||||||||||||||||||||||||||||||||||||
| 681 | |||||||||||||||||||||||||||||||||||||||||
| 682 | 570 | ▶ | if ( !$noenv ) { | ||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||
| 683 | 16 | my $finder = App::Ack::ConfigFinder->new; | |||||||||||||||||||||||||||||||||||||||
| 684 | 16 | @files = $finder->find_config_files; | |||||||||||||||||||||||||||||||||||||||
| 685 | } | ||||||||||||||||||||||||||||||||||||||||
| 686 | 570 | ▶ | if ( $ackrc ) { | ||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||
| 687 | # We explicitly use open so we get a nice error message. | ||||||||||||||||||||||||||||||||||||||||
| 688 | # XXX This is a potential race condition!. | ||||||||||||||||||||||||||||||||||||||||
| 689 | 5 | ▶ | if ( open my $fh, '<', $ackrc ) { | ||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||
| 690 | 4 | close $fh; | |||||||||||||||||||||||||||||||||||||||
| 691 | } | ||||||||||||||||||||||||||||||||||||||||
| 692 | else { | ||||||||||||||||||||||||||||||||||||||||
| 693 | 1 | App::Ack::die( "Unable to load ackrc '$ackrc': $!" ); | |||||||||||||||||||||||||||||||||||||||
| 694 | } | ||||||||||||||||||||||||||||||||||||||||
| 695 | 4 | push( @files, { path => $ackrc } ); | |||||||||||||||||||||||||||||||||||||||
| 696 | } | ||||||||||||||||||||||||||||||||||||||||
| 697 | |||||||||||||||||||||||||||||||||||||||||
| 698 | 569 | push @arg_sources, { | |||||||||||||||||||||||||||||||||||||||
| 699 | name => 'Defaults', | ||||||||||||||||||||||||||||||||||||||||
| 700 | contents => [ App::Ack::ConfigDefault::options_clean() ], | ||||||||||||||||||||||||||||||||||||||||
| 701 | }; | ||||||||||||||||||||||||||||||||||||||||
| 702 | |||||||||||||||||||||||||||||||||||||||||
| 703 | 569 | foreach my $file ( @files) { | |||||||||||||||||||||||||||||||||||||||
| 704 | 30 | my @lines = read_rcfile($file->{path}); | |||||||||||||||||||||||||||||||||||||||
| 705 | 30 | ▶ | if ( @lines ) { | ||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||
| 706 | push @arg_sources, { | ||||||||||||||||||||||||||||||||||||||||
| 707 | name => $file->{path}, | ||||||||||||||||||||||||||||||||||||||||
| 708 | contents => \@lines, | ||||||||||||||||||||||||||||||||||||||||
| 709 | project => $file->{project}, | ||||||||||||||||||||||||||||||||||||||||
| 710 | 14 | is_ackrc => 1, | |||||||||||||||||||||||||||||||||||||||
| 711 | }; | ||||||||||||||||||||||||||||||||||||||||
| 712 | } | ||||||||||||||||||||||||||||||||||||||||
| 713 | } | ||||||||||||||||||||||||||||||||||||||||
| 714 | |||||||||||||||||||||||||||||||||||||||||
| 715 | 569 | push @arg_sources, { | |||||||||||||||||||||||||||||||||||||||
| 716 | name => 'ARGV', | ||||||||||||||||||||||||||||||||||||||||
| 717 | contents => [ @ARGV ], | ||||||||||||||||||||||||||||||||||||||||
| 718 | }; | ||||||||||||||||||||||||||||||||||||||||
| 719 | |||||||||||||||||||||||||||||||||||||||||
| 720 | 569 | return @arg_sources; | |||||||||||||||||||||||||||||||||||||||
| 721 | } | ||||||||||||||||||||||||||||||||||||||||
| 722 | |||||||||||||||||||||||||||||||||||||||||
| 723 | |||||||||||||||||||||||||||||||||||||||||
| 724 | 30 | ▶ | sub read_rcfile { | ||||||||||||||||||||||||||||||||||||||
|
Subroutine
read_rcfile: called CC=8 SCAR=20.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||
| 725 | 30 | my $file = shift; | |||||||||||||||||||||||||||||||||||||||
| 726 | |||||||||||||||||||||||||||||||||||||||||
| 727 | 30 | ▶ | return unless defined $file && -e $file; | ||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
defined $file and -e $file
MC/DC50%1/2
defined $file and -e $file
defined $file
-e $file
Truth table66%2/3
A and B
A= defined $fileB= -e $file
| |||||||||||||||||||||||||||||||||||||||||
| 728 | |||||||||||||||||||||||||||||||||||||||||
| 729 | 14 | my @lines; | |||||||||||||||||||||||||||||||||||||||
| 730 | |||||||||||||||||||||||||||||||||||||||||
| 731 | 14 | ▶ | open( my $fh, '<', $file ) or App::Ack::die( "Unable to read $file: $!" ); | ||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||
| 732 | 14 | ▶ | while ( defined( my $line = <$fh> ) ) { | ||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||
| 733 | 49 | chomp $line; | |||||||||||||||||||||||||||||||||||||||
| 734 | 49 | $line =~ s/^\s+//; | |||||||||||||||||||||||||||||||||||||||
| 735 | 49 | $line =~ s/\s+$//; | |||||||||||||||||||||||||||||||||||||||
| 736 | |||||||||||||||||||||||||||||||||||||||||
| 737 | 49 | ▶ | next if $line eq ''; | ||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||
| 738 | 43 | ▶ | next if $line =~ /^\s*#/; | ||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||
| 739 | |||||||||||||||||||||||||||||||||||||||||
| 740 | 37 | push( @lines, $line ); | |||||||||||||||||||||||||||||||||||||||
| 741 | } | ||||||||||||||||||||||||||||||||||||||||
| 742 | 14 | ▶ | close $fh or App::Ack::die( "Unable to close $file: $!" ); | ||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||
| 743 | |||||||||||||||||||||||||||||||||||||||||
| 744 | 14 | return @lines; | |||||||||||||||||||||||||||||||||||||||
| 745 | } | ||||||||||||||||||||||||||||||||||||||||
| 746 | |||||||||||||||||||||||||||||||||||||||||
| 747 | |||||||||||||||||||||||||||||||||||||||||
| 748 | # Verifies no mutex options were passed. Dies if they were. | ||||||||||||||||||||||||||||||||||||||||
| 749 | 602 | ▶ | sub _check_for_mutex_options { | ||||||||||||||||||||||||||||||||||||||
|
Subroutine
_check_for_mutex_options: called CC=5 SCAR=16.1
| |||||||||||||||||||||||||||||||||||||||||
| 750 | 602 | my $type_specs = shift; | |||||||||||||||||||||||||||||||||||||||
| 751 | |||||||||||||||||||||||||||||||||||||||||
| 752 | 602 | my $mutex = mutex_options(); | |||||||||||||||||||||||||||||||||||||||
| 753 | |||||||||||||||||||||||||||||||||||||||||
| 754 | 602 | my ($raw,$used) = _options_used( $type_specs ); | |||||||||||||||||||||||||||||||||||||||
| 755 | |||||||||||||||||||||||||||||||||||||||||
| 756 | 602 | my @used = sort { lc $a cmp lc $b } keys %{$used}; | |||||||||||||||||||||||||||||||||||||||
| 757 | |||||||||||||||||||||||||||||||||||||||||
| 758 | 602 | for my $i ( @used ) { | |||||||||||||||||||||||||||||||||||||||
| 759 | 947 | for my $j ( @used ) { | |||||||||||||||||||||||||||||||||||||||
| 760 | 2355 | ▶ | next if $i eq $j; | ||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||
| 761 | 1408 | ▶ | if ( $mutex->{$i}{$j} ) { | ||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||
| 762 | 176 | my $x = $raw->[ $used->{$i} ]; | |||||||||||||||||||||||||||||||||||||||
| 763 | 176 | my $y = $raw->[ $used->{$j} ]; | |||||||||||||||||||||||||||||||||||||||
| 764 | 176 | App::Ack::die( "Options '$x' and '$y' can't be used together." ); | |||||||||||||||||||||||||||||||||||||||
| 765 | } | ||||||||||||||||||||||||||||||||||||||||
| 766 | } | ||||||||||||||||||||||||||||||||||||||||
| 767 | } | ||||||||||||||||||||||||||||||||||||||||
| 768 | |||||||||||||||||||||||||||||||||||||||||
| 769 | 426 | return; | |||||||||||||||||||||||||||||||||||||||
| 770 | } | ||||||||||||||||||||||||||||||||||||||||
| 771 | |||||||||||||||||||||||||||||||||||||||||
| 772 | |||||||||||||||||||||||||||||||||||||||||
| 773 | # Processes the command line option and returns a hash of the options that were | ||||||||||||||||||||||||||||||||||||||||
| 774 | # used on the command line, using their full name. "--prox" shows up in the hash as "--proximate". | ||||||||||||||||||||||||||||||||||||||||
| 775 | 602 | ▶ | sub _options_used { | ||||||||||||||||||||||||||||||||||||||
|
Subroutine
_options_used: called CC=8 SCAR=20.8
| |||||||||||||||||||||||||||||||||||||||||
| 776 | 602 | my $type_specs = shift; | |||||||||||||||||||||||||||||||||||||||
| 777 | |||||||||||||||||||||||||||||||||||||||||
| 778 | 602 | my %dummy_opt; | |||||||||||||||||||||||||||||||||||||||
| 779 | 602 | my $real_spec = get_arg_spec( \%dummy_opt, $type_specs ); | |||||||||||||||||||||||||||||||||||||||
| 780 | |||||||||||||||||||||||||||||||||||||||||
| 781 | # The real argument parsing doesn't check for --type-add, --type-del or --type-set because | ||||||||||||||||||||||||||||||||||||||||
| 782 | # they get removed by the argument processing. We have to account for them here. | ||||||||||||||||||||||||||||||||||||||||
| 783 | 602 | ▶ | my $sub_dummy = sub {}; | ||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||
| 784 | $real_spec = { | ||||||||||||||||||||||||||||||||||||||||
| 785 | 602 | %{$real_spec}, | |||||||||||||||||||||||||||||||||||||||
| 786 | 'type-add=s' => $sub_dummy, | ||||||||||||||||||||||||||||||||||||||||
| 787 | 'type-del=s' => $sub_dummy, | ||||||||||||||||||||||||||||||||||||||||
| 788 | 'type-set=s' => $sub_dummy, | ||||||||||||||||||||||||||||||||||||||||
| 789 | 'ignore-ack-defaults' => $sub_dummy, | ||||||||||||||||||||||||||||||||||||||||
| 790 | }; | ||||||||||||||||||||||||||||||||||||||||
| 791 | |||||||||||||||||||||||||||||||||||||||||
| 792 | 602 | my %parsed; | |||||||||||||||||||||||||||||||||||||||
| 793 | my @raw; | ||||||||||||||||||||||||||||||||||||||||
| 794 | 602 | my %spec_capture_parsed; | |||||||||||||||||||||||||||||||||||||||
| 795 | 602 | my %spec_capture_raw; | |||||||||||||||||||||||||||||||||||||||
| 796 | |||||||||||||||||||||||||||||||||||||||||
| 797 | =pod | ||||||||||||||||||||||||||||||||||||||||
| 798 | |||||||||||||||||||||||||||||||||||||||||
| 799 | We have to build two argument specs. | ||||||||||||||||||||||||||||||||||||||||
| 800 | |||||||||||||||||||||||||||||||||||||||||
| 801 | To populate the C<%parsed> hash: Capture the arguments that the user has | ||||||||||||||||||||||||||||||||||||||||
| 802 | passed in, as parsed by the Getopt::Long::GetOptions function. Aliases are converted | ||||||||||||||||||||||||||||||||||||||||
| 803 | down to their short options. If a user passes "--proximate", Getopt::Long | ||||||||||||||||||||||||||||||||||||||||
| 804 | converts that to "-p" and we store it as "-p". | ||||||||||||||||||||||||||||||||||||||||
| 805 | |||||||||||||||||||||||||||||||||||||||||
| 806 | To populate the C<@raw> array: Capture the arguments raw, without having | ||||||||||||||||||||||||||||||||||||||||
| 807 | been converted to their short options. If a user passes "--proximate", | ||||||||||||||||||||||||||||||||||||||||
| 808 | we store it in C<@raw> as "--proximate". | ||||||||||||||||||||||||||||||||||||||||
| 809 | |||||||||||||||||||||||||||||||||||||||||
| 810 | =cut | ||||||||||||||||||||||||||||||||||||||||
| 811 | |||||||||||||||||||||||||||||||||||||||||
| 812 | # Capture the %parsed hash. | ||||||||||||||||||||||||||||||||||||||||
| 813 | CAPTURE_PARSED: { | ||||||||||||||||||||||||||||||||||||||||
| 814 | 602 | my $parsed_pos = 0; | |||||||||||||||||||||||||||||||||||||||
| 815 | 1209 | ▶ | my $sub_count = sub { | ||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||
| 816 | 1209 | my $arg = shift; | |||||||||||||||||||||||||||||||||||||||
| 817 | 1209 | $arg = "$arg"; | |||||||||||||||||||||||||||||||||||||||
| 818 | 1209 | $parsed{$arg} = $parsed_pos++; | |||||||||||||||||||||||||||||||||||||||
| 819 | 602 | }; | |||||||||||||||||||||||||||||||||||||||
| 820 | %spec_capture_parsed = ( | ||||||||||||||||||||||||||||||||||||||||
| 821 | 1006 | ▶ | '<>' => sub { $parsed_pos++ }, # Bump forward one pos for non-options. | ||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||
| 822 | 602 | map { $_ => $sub_count } keys %{$real_spec} | |||||||||||||||||||||||||||||||||||||||
| 823 | ); | ||||||||||||||||||||||||||||||||||||||||
| 824 | } | ||||||||||||||||||||||||||||||||||||||||
| 825 | |||||||||||||||||||||||||||||||||||||||||
| 826 | # Capture the @raw array. | ||||||||||||||||||||||||||||||||||||||||
| 827 | CAPTURE_RAW: { | ||||||||||||||||||||||||||||||||||||||||
| 828 | 602 | my $raw_pos = 0; | |||||||||||||||||||||||||||||||||||||||
| 829 | %spec_capture_raw = ( | ||||||||||||||||||||||||||||||||||||||||
| 830 | 1006 | ▶ | '<>' => sub { $raw_pos++ }, # Bump forward one pos for non-options. | ||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||
| 831 | 602 | ); | |||||||||||||||||||||||||||||||||||||||
| 832 | |||||||||||||||||||||||||||||||||||||||||
| 833 | 1209 | ▶ | my $sub_count = sub { | ||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=2 SCAR=6.9
| |||||||||||||||||||||||||||||||||||||||||
| 834 | 1209 | my $arg = shift; | |||||||||||||||||||||||||||||||||||||||
| 835 | |||||||||||||||||||||||||||||||||||||||||
| 836 | 1209 | $arg = "$arg"; | |||||||||||||||||||||||||||||||||||||||
| 837 | 1209 | ▶ | $raw[$raw_pos] = length($arg) == 1 ? "-$arg" : "--$arg"; | ||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||
| 838 | 1209 | $raw_pos++; | |||||||||||||||||||||||||||||||||||||||
| 839 | 602 | }; | |||||||||||||||||||||||||||||||||||||||
| 840 | |||||||||||||||||||||||||||||||||||||||||
| 841 | 602 | for my $opt_spec ( keys %{$real_spec} ) { | |||||||||||||||||||||||||||||||||||||||
| 842 | 87662 | my $negatable; | |||||||||||||||||||||||||||||||||||||||
| 843 | my $type; | ||||||||||||||||||||||||||||||||||||||||
| 844 | 87662 | my $default; | |||||||||||||||||||||||||||||||||||||||
| 845 | |||||||||||||||||||||||||||||||||||||||||
| 846 | 87662 | $negatable = ($opt_spec =~ s/!$//); | |||||||||||||||||||||||||||||||||||||||
| 847 | |||||||||||||||||||||||||||||||||||||||||
| 848 | 87662 | ▶ | if ( $opt_spec =~ s/(=[si])$// ) { | ||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||
| 849 | 12642 | $type = $1; | |||||||||||||||||||||||||||||||||||||||
| 850 | } | ||||||||||||||||||||||||||||||||||||||||
| 851 | 87662 | ▶ | if ( $opt_spec =~ s/(:.+)$// ) { | ||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||
| 852 | 3010 | $default = $1; | |||||||||||||||||||||||||||||||||||||||
| 853 | } | ||||||||||||||||||||||||||||||||||||||||
| 854 | |||||||||||||||||||||||||||||||||||||||||
| 855 | 87662 | my @aliases = split( /\|/, $opt_spec ); | |||||||||||||||||||||||||||||||||||||||
| 856 | 87662 | for my $alias ( @aliases ) { | |||||||||||||||||||||||||||||||||||||||
| 857 | 102110 | ▶ | $alias .= $type if defined $type; | ||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||
| 858 | 102110 | ▶ | $alias .= $default if defined $default; | ||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||
| 859 | 102110 | ▶ | $alias .= '!' if $negatable; | ||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||
| 860 | |||||||||||||||||||||||||||||||||||||||||
| 861 | 102110 | $spec_capture_raw{$alias} = $sub_count; | |||||||||||||||||||||||||||||||||||||||
| 862 | } | ||||||||||||||||||||||||||||||||||||||||
| 863 | } | ||||||||||||||||||||||||||||||||||||||||
| 864 | } | ||||||||||||||||||||||||||||||||||||||||
| 865 | |||||||||||||||||||||||||||||||||||||||||
| 866 | # Parse @ARGV twice, once with each capture spec. | ||||||||||||||||||||||||||||||||||||||||
| 867 | 602 | configure_parser( 'pass_through' ); # Ignore invalid options. | |||||||||||||||||||||||||||||||||||||||
| 868 | 602 | Getopt::Long::GetOptionsFromArray( [@ARGV], %spec_capture_raw ); | |||||||||||||||||||||||||||||||||||||||
| 869 | 602 | Getopt::Long::GetOptionsFromArray( [@ARGV], %spec_capture_parsed ); | |||||||||||||||||||||||||||||||||||||||
| 870 | |||||||||||||||||||||||||||||||||||||||||
| 871 | 602 | return (\@raw,\%parsed); | |||||||||||||||||||||||||||||||||||||||
| 872 | } | ||||||||||||||||||||||||||||||||||||||||
| 873 | |||||||||||||||||||||||||||||||||||||||||
| 874 | |||||||||||||||||||||||||||||||||||||||||
| 875 | 602 | ▶ | sub mutex_options { | ||||||||||||||||||||||||||||||||||||||
|
Subroutine
mutex_options: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||
| 876 | # This list is machine-generated by dev/crank-mutex. Do not modify it by hand. | ||||||||||||||||||||||||||||||||||||||||
| 877 | |||||||||||||||||||||||||||||||||||||||||
| 878 | return { | ||||||||||||||||||||||||||||||||||||||||
| 879 | 602 | 1 => { | |||||||||||||||||||||||||||||||||||||||
| 880 | m => 1, | ||||||||||||||||||||||||||||||||||||||||
| 881 | passthru => 1, | ||||||||||||||||||||||||||||||||||||||||
| 882 | }, | ||||||||||||||||||||||||||||||||||||||||
| 883 | A => { | ||||||||||||||||||||||||||||||||||||||||
| 884 | L => 1, | ||||||||||||||||||||||||||||||||||||||||
| 885 | c => 1, | ||||||||||||||||||||||||||||||||||||||||
| 886 | f => 1, | ||||||||||||||||||||||||||||||||||||||||
| 887 | g => 1, | ||||||||||||||||||||||||||||||||||||||||
| 888 | l => 1, | ||||||||||||||||||||||||||||||||||||||||
| 889 | o => 1, | ||||||||||||||||||||||||||||||||||||||||
| 890 | output => 1, | ||||||||||||||||||||||||||||||||||||||||
| 891 | p => 1, | ||||||||||||||||||||||||||||||||||||||||
| 892 | passthru => 1, | ||||||||||||||||||||||||||||||||||||||||
| 893 | }, | ||||||||||||||||||||||||||||||||||||||||
| 894 | B => { | ||||||||||||||||||||||||||||||||||||||||
| 895 | L => 1, | ||||||||||||||||||||||||||||||||||||||||
| 896 | c => 1, | ||||||||||||||||||||||||||||||||||||||||
| 897 | f => 1, | ||||||||||||||||||||||||||||||||||||||||
| 898 | g => 1, | ||||||||||||||||||||||||||||||||||||||||
| 899 | l => 1, | ||||||||||||||||||||||||||||||||||||||||
| 900 | o => 1, | ||||||||||||||||||||||||||||||||||||||||
| 901 | output => 1, | ||||||||||||||||||||||||||||||||||||||||
| 902 | p => 1, | ||||||||||||||||||||||||||||||||||||||||
| 903 | passthru => 1, | ||||||||||||||||||||||||||||||||||||||||
| 904 | }, | ||||||||||||||||||||||||||||||||||||||||
| 905 | C => { | ||||||||||||||||||||||||||||||||||||||||
| 906 | L => 1, | ||||||||||||||||||||||||||||||||||||||||
| 907 | c => 1, | ||||||||||||||||||||||||||||||||||||||||
| 908 | f => 1, | ||||||||||||||||||||||||||||||||||||||||
| 909 | g => 1, | ||||||||||||||||||||||||||||||||||||||||
| 910 | l => 1, | ||||||||||||||||||||||||||||||||||||||||
| 911 | o => 1, | ||||||||||||||||||||||||||||||||||||||||
| 912 | output => 1, | ||||||||||||||||||||||||||||||||||||||||
| 913 | p => 1, | ||||||||||||||||||||||||||||||||||||||||
| 914 | passthru => 1, | ||||||||||||||||||||||||||||||||||||||||
| 915 | }, | ||||||||||||||||||||||||||||||||||||||||
| 916 | H => { | ||||||||||||||||||||||||||||||||||||||||
| 917 | L => 1, | ||||||||||||||||||||||||||||||||||||||||
| 918 | f => 1, | ||||||||||||||||||||||||||||||||||||||||
| 919 | g => 1, | ||||||||||||||||||||||||||||||||||||||||
| 920 | l => 1, | ||||||||||||||||||||||||||||||||||||||||
| 921 | }, | ||||||||||||||||||||||||||||||||||||||||
| 922 | I => { | ||||||||||||||||||||||||||||||||||||||||
| 923 | f => 1, | ||||||||||||||||||||||||||||||||||||||||
| 924 | }, | ||||||||||||||||||||||||||||||||||||||||
| 925 | L => { | ||||||||||||||||||||||||||||||||||||||||
| 926 | A => 1, | ||||||||||||||||||||||||||||||||||||||||
| 927 | B => 1, | ||||||||||||||||||||||||||||||||||||||||
| 928 | C => 1, | ||||||||||||||||||||||||||||||||||||||||
| 929 | H => 1, | ||||||||||||||||||||||||||||||||||||||||
| 930 | L => 1, | ||||||||||||||||||||||||||||||||||||||||
| 931 | break => 1, | ||||||||||||||||||||||||||||||||||||||||
| 932 | c => 1, | ||||||||||||||||||||||||||||||||||||||||
| 933 | column => 1, | ||||||||||||||||||||||||||||||||||||||||
| 934 | f => 1, | ||||||||||||||||||||||||||||||||||||||||
| 935 | g => 1, | ||||||||||||||||||||||||||||||||||||||||
| 936 | group => 1, | ||||||||||||||||||||||||||||||||||||||||
| 937 | h => 1, | ||||||||||||||||||||||||||||||||||||||||
| 938 | heading => 1, | ||||||||||||||||||||||||||||||||||||||||
| 939 | l => 1, | ||||||||||||||||||||||||||||||||||||||||
| 940 | 'no-filename' => 1, | ||||||||||||||||||||||||||||||||||||||||
| 941 | o => 1, | ||||||||||||||||||||||||||||||||||||||||
| 942 | output => 1, | ||||||||||||||||||||||||||||||||||||||||
| 943 | p => 1, | ||||||||||||||||||||||||||||||||||||||||
| 944 | passthru => 1, | ||||||||||||||||||||||||||||||||||||||||
| 945 | 'show-types' => 1, | ||||||||||||||||||||||||||||||||||||||||
| 946 | v => 1, | ||||||||||||||||||||||||||||||||||||||||
| 947 | 'with-filename' => 1, | ||||||||||||||||||||||||||||||||||||||||
| 948 | }, | ||||||||||||||||||||||||||||||||||||||||
| 949 | and => { | ||||||||||||||||||||||||||||||||||||||||
| 950 | or => 1, | ||||||||||||||||||||||||||||||||||||||||
| 951 | }, | ||||||||||||||||||||||||||||||||||||||||
| 952 | break => { | ||||||||||||||||||||||||||||||||||||||||
| 953 | L => 1, | ||||||||||||||||||||||||||||||||||||||||
| 954 | c => 1, | ||||||||||||||||||||||||||||||||||||||||
| 955 | f => 1, | ||||||||||||||||||||||||||||||||||||||||
| 956 | g => 1, | ||||||||||||||||||||||||||||||||||||||||
| 957 | l => 1, | ||||||||||||||||||||||||||||||||||||||||
| 958 | }, | ||||||||||||||||||||||||||||||||||||||||
| 959 | c => { | ||||||||||||||||||||||||||||||||||||||||
| 960 | A => 1, | ||||||||||||||||||||||||||||||||||||||||
| 961 | B => 1, | ||||||||||||||||||||||||||||||||||||||||
| 962 | C => 1, | ||||||||||||||||||||||||||||||||||||||||
| 963 | L => 1, | ||||||||||||||||||||||||||||||||||||||||
| 964 | break => 1, | ||||||||||||||||||||||||||||||||||||||||
| 965 | column => 1, | ||||||||||||||||||||||||||||||||||||||||
| 966 | f => 1, | ||||||||||||||||||||||||||||||||||||||||
| 967 | g => 1, | ||||||||||||||||||||||||||||||||||||||||
| 968 | group => 1, | ||||||||||||||||||||||||||||||||||||||||
| 969 | heading => 1, | ||||||||||||||||||||||||||||||||||||||||
| 970 | m => 1, | ||||||||||||||||||||||||||||||||||||||||
| 971 | o => 1, | ||||||||||||||||||||||||||||||||||||||||
| 972 | output => 1, | ||||||||||||||||||||||||||||||||||||||||
| 973 | p => 1, | ||||||||||||||||||||||||||||||||||||||||
| 974 | passthru => 1, | ||||||||||||||||||||||||||||||||||||||||
| 975 | }, | ||||||||||||||||||||||||||||||||||||||||
| 976 | column => { | ||||||||||||||||||||||||||||||||||||||||
| 977 | L => 1, | ||||||||||||||||||||||||||||||||||||||||
| 978 | c => 1, | ||||||||||||||||||||||||||||||||||||||||
| 979 | f => 1, | ||||||||||||||||||||||||||||||||||||||||
| 980 | g => 1, | ||||||||||||||||||||||||||||||||||||||||
| 981 | l => 1, | ||||||||||||||||||||||||||||||||||||||||
| 982 | o => 1, | ||||||||||||||||||||||||||||||||||||||||
| 983 | output => 1, | ||||||||||||||||||||||||||||||||||||||||
| 984 | passthru => 1, | ||||||||||||||||||||||||||||||||||||||||
| 985 | v => 1, | ||||||||||||||||||||||||||||||||||||||||
| 986 | }, | ||||||||||||||||||||||||||||||||||||||||
| 987 | f => { | ||||||||||||||||||||||||||||||||||||||||
| 988 | A => 1, | ||||||||||||||||||||||||||||||||||||||||
| 989 | B => 1, | ||||||||||||||||||||||||||||||||||||||||
| 990 | C => 1, | ||||||||||||||||||||||||||||||||||||||||
| 991 | H => 1, | ||||||||||||||||||||||||||||||||||||||||
| 992 | I => 1, | ||||||||||||||||||||||||||||||||||||||||
| 993 | L => 1, | ||||||||||||||||||||||||||||||||||||||||
| 994 | break => 1, | ||||||||||||||||||||||||||||||||||||||||
| 995 | c => 1, | ||||||||||||||||||||||||||||||||||||||||
| 996 | column => 1, | ||||||||||||||||||||||||||||||||||||||||
| 997 | f => 1, | ||||||||||||||||||||||||||||||||||||||||
| 998 | 'files-from' => 1, | ||||||||||||||||||||||||||||||||||||||||
| 999 | g => 1, | ||||||||||||||||||||||||||||||||||||||||
| 1000 | group => 1, | ||||||||||||||||||||||||||||||||||||||||
| 1001 | h => 1, | ||||||||||||||||||||||||||||||||||||||||
| 1002 | heading => 1, | ||||||||||||||||||||||||||||||||||||||||
| 1003 | i => 1, | ||||||||||||||||||||||||||||||||||||||||
| 1004 | l => 1, | ||||||||||||||||||||||||||||||||||||||||
| 1005 | m => 1, | ||||||||||||||||||||||||||||||||||||||||
| 1006 | match => 1, | ||||||||||||||||||||||||||||||||||||||||
| 1007 | o => 1, | ||||||||||||||||||||||||||||||||||||||||
| 1008 | output => 1, | ||||||||||||||||||||||||||||||||||||||||
| 1009 | p => 1, | ||||||||||||||||||||||||||||||||||||||||
| 1010 | passthru => 1, | ||||||||||||||||||||||||||||||||||||||||
| 1011 | 'smart-case' => 1, | ||||||||||||||||||||||||||||||||||||||||
| 1012 | u => 1, | ||||||||||||||||||||||||||||||||||||||||
| 1013 | v => 1, | ||||||||||||||||||||||||||||||||||||||||
| 1014 | x => 1, | ||||||||||||||||||||||||||||||||||||||||
| 1015 | }, | ||||||||||||||||||||||||||||||||||||||||
| 1016 | 'files-from' => { | ||||||||||||||||||||||||||||||||||||||||
| 1017 | f => 1, | ||||||||||||||||||||||||||||||||||||||||
| 1018 | g => 1, | ||||||||||||||||||||||||||||||||||||||||
| 1019 | x => 1, | ||||||||||||||||||||||||||||||||||||||||
| 1020 | }, | ||||||||||||||||||||||||||||||||||||||||
| 1021 | g => { | ||||||||||||||||||||||||||||||||||||||||
| 1022 | A => 1, | ||||||||||||||||||||||||||||||||||||||||
| 1023 | B => 1, | ||||||||||||||||||||||||||||||||||||||||
| 1024 | C => 1, | ||||||||||||||||||||||||||||||||||||||||
| 1025 | H => 1, | ||||||||||||||||||||||||||||||||||||||||
| 1026 | L => 1, | ||||||||||||||||||||||||||||||||||||||||
| 1027 | break => 1, | ||||||||||||||||||||||||||||||||||||||||
| 1028 | c => 1, | ||||||||||||||||||||||||||||||||||||||||
| 1029 | column => 1, | ||||||||||||||||||||||||||||||||||||||||
| 1030 | f => 1, | ||||||||||||||||||||||||||||||||||||||||
| 1031 | 'files-from' => 1, | ||||||||||||||||||||||||||||||||||||||||
| 1032 | g => 1, | ||||||||||||||||||||||||||||||||||||||||
| 1033 | group => 1, | ||||||||||||||||||||||||||||||||||||||||
| 1034 | h => 1, | ||||||||||||||||||||||||||||||||||||||||
| 1035 | heading => 1, | ||||||||||||||||||||||||||||||||||||||||
| 1036 | l => 1, | ||||||||||||||||||||||||||||||||||||||||
| 1037 | m => 1, | ||||||||||||||||||||||||||||||||||||||||
| 1038 | match => 1, | ||||||||||||||||||||||||||||||||||||||||
| 1039 | o => 1, | ||||||||||||||||||||||||||||||||||||||||
| 1040 | output => 1, | ||||||||||||||||||||||||||||||||||||||||
| 1041 | p => 1, | ||||||||||||||||||||||||||||||||||||||||
| 1042 | passthru => 1, | ||||||||||||||||||||||||||||||||||||||||
| 1043 | u => 1, | ||||||||||||||||||||||||||||||||||||||||
| 1044 | x => 1, | ||||||||||||||||||||||||||||||||||||||||
| 1045 | }, | ||||||||||||||||||||||||||||||||||||||||
| 1046 | group => { | ||||||||||||||||||||||||||||||||||||||||
| 1047 | L => 1, | ||||||||||||||||||||||||||||||||||||||||
| 1048 | c => 1, | ||||||||||||||||||||||||||||||||||||||||
| 1049 | f => 1, | ||||||||||||||||||||||||||||||||||||||||
| 1050 | g => 1, | ||||||||||||||||||||||||||||||||||||||||
| 1051 | l => 1, | ||||||||||||||||||||||||||||||||||||||||
| 1052 | }, | ||||||||||||||||||||||||||||||||||||||||
| 1053 | h => { | ||||||||||||||||||||||||||||||||||||||||
| 1054 | L => 1, | ||||||||||||||||||||||||||||||||||||||||
| 1055 | f => 1, | ||||||||||||||||||||||||||||||||||||||||
| 1056 | g => 1, | ||||||||||||||||||||||||||||||||||||||||
| 1057 | l => 1, | ||||||||||||||||||||||||||||||||||||||||
| 1058 | }, | ||||||||||||||||||||||||||||||||||||||||
| 1059 | heading => { | ||||||||||||||||||||||||||||||||||||||||
| 1060 | L => 1, | ||||||||||||||||||||||||||||||||||||||||
| 1061 | c => 1, | ||||||||||||||||||||||||||||||||||||||||
| 1062 | f => 1, | ||||||||||||||||||||||||||||||||||||||||
| 1063 | g => 1, | ||||||||||||||||||||||||||||||||||||||||
| 1064 | l => 1, | ||||||||||||||||||||||||||||||||||||||||
| 1065 | }, | ||||||||||||||||||||||||||||||||||||||||
| 1066 | i => { | ||||||||||||||||||||||||||||||||||||||||
| 1067 | f => 1, | ||||||||||||||||||||||||||||||||||||||||
| 1068 | }, | ||||||||||||||||||||||||||||||||||||||||
| 1069 | l => { | ||||||||||||||||||||||||||||||||||||||||
| 1070 | A => 1, | ||||||||||||||||||||||||||||||||||||||||
| 1071 | B => 1, | ||||||||||||||||||||||||||||||||||||||||
| 1072 | C => 1, | ||||||||||||||||||||||||||||||||||||||||
| 1073 | H => 1, | ||||||||||||||||||||||||||||||||||||||||
| 1074 | L => 1, | ||||||||||||||||||||||||||||||||||||||||
| 1075 | break => 1, | ||||||||||||||||||||||||||||||||||||||||
| 1076 | column => 1, | ||||||||||||||||||||||||||||||||||||||||
| 1077 | f => 1, | ||||||||||||||||||||||||||||||||||||||||
| 1078 | g => 1, | ||||||||||||||||||||||||||||||||||||||||
| 1079 | group => 1, | ||||||||||||||||||||||||||||||||||||||||
| 1080 | h => 1, | ||||||||||||||||||||||||||||||||||||||||
| 1081 | heading => 1, | ||||||||||||||||||||||||||||||||||||||||
| 1082 | l => 1, | ||||||||||||||||||||||||||||||||||||||||
| 1083 | 'no-filename' => 1, | ||||||||||||||||||||||||||||||||||||||||
| 1084 | o => 1, | ||||||||||||||||||||||||||||||||||||||||
| 1085 | output => 1, | ||||||||||||||||||||||||||||||||||||||||
| 1086 | p => 1, | ||||||||||||||||||||||||||||||||||||||||
| 1087 | passthru => 1, | ||||||||||||||||||||||||||||||||||||||||
| 1088 | 'show-types' => 1, | ||||||||||||||||||||||||||||||||||||||||
| 1089 | 'with-filename' => 1, | ||||||||||||||||||||||||||||||||||||||||
| 1090 | }, | ||||||||||||||||||||||||||||||||||||||||
| 1091 | m => { | ||||||||||||||||||||||||||||||||||||||||
| 1092 | 1 => 1, | ||||||||||||||||||||||||||||||||||||||||
| 1093 | c => 1, | ||||||||||||||||||||||||||||||||||||||||
| 1094 | f => 1, | ||||||||||||||||||||||||||||||||||||||||
| 1095 | g => 1, | ||||||||||||||||||||||||||||||||||||||||
| 1096 | passthru => 1, | ||||||||||||||||||||||||||||||||||||||||
| 1097 | }, | ||||||||||||||||||||||||||||||||||||||||
| 1098 | match => { | ||||||||||||||||||||||||||||||||||||||||
| 1099 | f => 1, | ||||||||||||||||||||||||||||||||||||||||
| 1100 | g => 1, | ||||||||||||||||||||||||||||||||||||||||
| 1101 | }, | ||||||||||||||||||||||||||||||||||||||||
| 1102 | 'no-filename' => { | ||||||||||||||||||||||||||||||||||||||||
| 1103 | L => 1, | ||||||||||||||||||||||||||||||||||||||||
| 1104 | l => 1, | ||||||||||||||||||||||||||||||||||||||||
| 1105 | }, | ||||||||||||||||||||||||||||||||||||||||
| 1106 | o => { | ||||||||||||||||||||||||||||||||||||||||
| 1107 | A => 1, | ||||||||||||||||||||||||||||||||||||||||
| 1108 | B => 1, | ||||||||||||||||||||||||||||||||||||||||
| 1109 | C => 1, | ||||||||||||||||||||||||||||||||||||||||
| 1110 | L => 1, | ||||||||||||||||||||||||||||||||||||||||
| 1111 | c => 1, | ||||||||||||||||||||||||||||||||||||||||
| 1112 | column => 1, | ||||||||||||||||||||||||||||||||||||||||
| 1113 | f => 1, | ||||||||||||||||||||||||||||||||||||||||
| 1114 | g => 1, | ||||||||||||||||||||||||||||||||||||||||
| 1115 | l => 1, | ||||||||||||||||||||||||||||||||||||||||
| 1116 | o => 1, | ||||||||||||||||||||||||||||||||||||||||
| 1117 | output => 1, | ||||||||||||||||||||||||||||||||||||||||
| 1118 | p => 1, | ||||||||||||||||||||||||||||||||||||||||
| 1119 | passthru => 1, | ||||||||||||||||||||||||||||||||||||||||
| 1120 | 'show-types' => 1, | ||||||||||||||||||||||||||||||||||||||||
| 1121 | v => 1, | ||||||||||||||||||||||||||||||||||||||||
| 1122 | }, | ||||||||||||||||||||||||||||||||||||||||
| 1123 | or => { | ||||||||||||||||||||||||||||||||||||||||
| 1124 | and => 1, | ||||||||||||||||||||||||||||||||||||||||
| 1125 | }, | ||||||||||||||||||||||||||||||||||||||||
| 1126 | output => { | ||||||||||||||||||||||||||||||||||||||||
| 1127 | A => 1, | ||||||||||||||||||||||||||||||||||||||||
| 1128 | B => 1, | ||||||||||||||||||||||||||||||||||||||||
| 1129 | C => 1, | ||||||||||||||||||||||||||||||||||||||||
| 1130 | L => 1, | ||||||||||||||||||||||||||||||||||||||||
| 1131 | c => 1, | ||||||||||||||||||||||||||||||||||||||||
| 1132 | column => 1, | ||||||||||||||||||||||||||||||||||||||||
| 1133 | f => 1, | ||||||||||||||||||||||||||||||||||||||||
| 1134 | g => 1, | ||||||||||||||||||||||||||||||||||||||||
| 1135 | l => 1, | ||||||||||||||||||||||||||||||||||||||||
| 1136 | o => 1, | ||||||||||||||||||||||||||||||||||||||||
| 1137 | output => 1, | ||||||||||||||||||||||||||||||||||||||||
| 1138 | p => 1, | ||||||||||||||||||||||||||||||||||||||||
| 1139 | passthru => 1, | ||||||||||||||||||||||||||||||||||||||||
| 1140 | 'show-types' => 1, | ||||||||||||||||||||||||||||||||||||||||
| 1141 | u => 1, | ||||||||||||||||||||||||||||||||||||||||
| 1142 | v => 1, | ||||||||||||||||||||||||||||||||||||||||
| 1143 | }, | ||||||||||||||||||||||||||||||||||||||||
| 1144 | p => { | ||||||||||||||||||||||||||||||||||||||||
| 1145 | A => 1, | ||||||||||||||||||||||||||||||||||||||||
| 1146 | B => 1, | ||||||||||||||||||||||||||||||||||||||||
| 1147 | C => 1, | ||||||||||||||||||||||||||||||||||||||||
| 1148 | L => 1, | ||||||||||||||||||||||||||||||||||||||||
| 1149 | c => 1, | ||||||||||||||||||||||||||||||||||||||||
| 1150 | f => 1, | ||||||||||||||||||||||||||||||||||||||||
| 1151 | g => 1, | ||||||||||||||||||||||||||||||||||||||||
| 1152 | l => 1, | ||||||||||||||||||||||||||||||||||||||||
| 1153 | o => 1, | ||||||||||||||||||||||||||||||||||||||||
| 1154 | output => 1, | ||||||||||||||||||||||||||||||||||||||||
| 1155 | p => 1, | ||||||||||||||||||||||||||||||||||||||||
| 1156 | passthru => 1, | ||||||||||||||||||||||||||||||||||||||||
| 1157 | }, | ||||||||||||||||||||||||||||||||||||||||
| 1158 | passthru => { | ||||||||||||||||||||||||||||||||||||||||
| 1159 | 1 => 1, | ||||||||||||||||||||||||||||||||||||||||
| 1160 | A => 1, | ||||||||||||||||||||||||||||||||||||||||
| 1161 | B => 1, | ||||||||||||||||||||||||||||||||||||||||
| 1162 | C => 1, | ||||||||||||||||||||||||||||||||||||||||
| 1163 | L => 1, | ||||||||||||||||||||||||||||||||||||||||
| 1164 | c => 1, | ||||||||||||||||||||||||||||||||||||||||
| 1165 | column => 1, | ||||||||||||||||||||||||||||||||||||||||
| 1166 | f => 1, | ||||||||||||||||||||||||||||||||||||||||
| 1167 | g => 1, | ||||||||||||||||||||||||||||||||||||||||
| 1168 | l => 1, | ||||||||||||||||||||||||||||||||||||||||
| 1169 | m => 1, | ||||||||||||||||||||||||||||||||||||||||
| 1170 | o => 1, | ||||||||||||||||||||||||||||||||||||||||
| 1171 | output => 1, | ||||||||||||||||||||||||||||||||||||||||
| 1172 | p => 1, | ||||||||||||||||||||||||||||||||||||||||
| 1173 | v => 1, | ||||||||||||||||||||||||||||||||||||||||
| 1174 | }, | ||||||||||||||||||||||||||||||||||||||||
| 1175 | 'show-types' => { | ||||||||||||||||||||||||||||||||||||||||
| 1176 | L => 1, | ||||||||||||||||||||||||||||||||||||||||
| 1177 | l => 1, | ||||||||||||||||||||||||||||||||||||||||
| 1178 | o => 1, | ||||||||||||||||||||||||||||||||||||||||
| 1179 | output => 1, | ||||||||||||||||||||||||||||||||||||||||
| 1180 | }, | ||||||||||||||||||||||||||||||||||||||||
| 1181 | 'smart-case' => { | ||||||||||||||||||||||||||||||||||||||||
| 1182 | f => 1, | ||||||||||||||||||||||||||||||||||||||||
| 1183 | }, | ||||||||||||||||||||||||||||||||||||||||
| 1184 | u => { | ||||||||||||||||||||||||||||||||||||||||
| 1185 | f => 1, | ||||||||||||||||||||||||||||||||||||||||
| 1186 | g => 1, | ||||||||||||||||||||||||||||||||||||||||
| 1187 | output => 1, | ||||||||||||||||||||||||||||||||||||||||
| 1188 | }, | ||||||||||||||||||||||||||||||||||||||||
| 1189 | v => { | ||||||||||||||||||||||||||||||||||||||||
| 1190 | L => 1, | ||||||||||||||||||||||||||||||||||||||||
| 1191 | column => 1, | ||||||||||||||||||||||||||||||||||||||||
| 1192 | f => 1, | ||||||||||||||||||||||||||||||||||||||||
| 1193 | o => 1, | ||||||||||||||||||||||||||||||||||||||||
| 1194 | output => 1, | ||||||||||||||||||||||||||||||||||||||||
| 1195 | passthru => 1, | ||||||||||||||||||||||||||||||||||||||||
| 1196 | }, | ||||||||||||||||||||||||||||||||||||||||
| 1197 | 'with-filename' => { | ||||||||||||||||||||||||||||||||||||||||
| 1198 | L => 1, | ||||||||||||||||||||||||||||||||||||||||
| 1199 | l => 1, | ||||||||||||||||||||||||||||||||||||||||
| 1200 | }, | ||||||||||||||||||||||||||||||||||||||||
| 1201 | x => { | ||||||||||||||||||||||||||||||||||||||||
| 1202 | f => 1, | ||||||||||||||||||||||||||||||||||||||||
| 1203 | 'files-from' => 1, | ||||||||||||||||||||||||||||||||||||||||
| 1204 | g => 1, | ||||||||||||||||||||||||||||||||||||||||
| 1205 | }, | ||||||||||||||||||||||||||||||||||||||||
| 1206 | }; | ||||||||||||||||||||||||||||||||||||||||
| 1207 | |||||||||||||||||||||||||||||||||||||||||
| 1208 | } # End of mutex_options() | ||||||||||||||||||||||||||||||||||||||||
| 1209 | |||||||||||||||||||||||||||||||||||||||||
| 1210 | |||||||||||||||||||||||||||||||||||||||||
| 1211 | 582 | 1; # End of App::Ack::ConfigLoader | |||||||||||||||||||||||||||||||||||||||