| 1 | package App::cdif::Command; | ||||||||||||
| 2 | |||||||||||||
| 3 | 16 | ▶ | use v5.14; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 4 | 16 | ▶ | use warnings; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 5 | 16 | ▶ | use utf8; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 6 | |||||||||||||
| 7 | 16 | ▶ | use parent 'Command::Run'; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 8 | |||||||||||||
| 9 | # Compatibility: expand array reference in command | ||||||||||||
| 10 | 0 | ▶ | sub command { | ||||||||||
|
Subroutine
command: not called CC=3 SCAR=24.8
Pod
documented
| |||||||||||||
| 11 | 0 | my $obj = shift; | |||||||||||
| 12 | 0 | ▶ | if (@_) { | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 13 | 0 | ▶ | my @cmd = map { ref eq 'ARRAY' ? @$_ : $_ } @_; | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 14 | 0 | return $obj->SUPER::command(@cmd); | |||||||||||
| 15 | } | ||||||||||||
| 16 | 0 | $obj->SUPER::command; | |||||||||||
| 17 | } | ||||||||||||
| 18 | |||||||||||||
| 19 | # Compatibility wrapper for read_error option | ||||||||||||
| 20 | 0 | ▶ | sub option { | ||||||||||
|
Subroutine
option: not called CC=8 SCAR=42.8
Pod
documented
| |||||||||||||
| 21 | 0 | my $obj = shift; | |||||||||||
| 22 | 0 | ▶ | if (@_ == 1) { | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 23 | 0 | my $key = shift; | |||||||||||
| 24 | 0 | ▶ | if ($key eq 'read_error') { | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 25 | 0 | ▶ | my $stderr = $obj->SUPER::option('stderr') // ''; | ||||||||||
|
Condition0%0/2
$obj->SUPER::option("stderr") // ""
MC/DC0%0/1
$obj->SUPER::option("stderr") // ""
$obj->SUPER::option("stderr")
Truth table0%0/2
A
A= $obj->SUPER::option("stderr")
| |||||||||||||
| 26 | 0 | ▶ | return $stderr eq 'redirect' ? 1 : 0; | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 27 | } | ||||||||||||
| 28 | 0 | return $obj->SUPER::option($key); | |||||||||||
| 29 | } else { | ||||||||||||
| 30 | 0 | ▶ | while (my($k, $v) = splice @_, 0, 2) { | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 31 | 0 | ▶ | if ($k eq 'read_error') { | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 32 | 0 | ▶ | $obj->SUPER::option(stderr => $v ? 'redirect' : undef); | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 33 | } else { | ||||||||||||
| 34 | 0 | $obj->SUPER::option($k => $v); | |||||||||||
| 35 | } | ||||||||||||
| 36 | } | ||||||||||||
| 37 | 0 | return $obj; | |||||||||||
| 38 | } | ||||||||||||
| 39 | } | ||||||||||||
| 40 | |||||||||||||
| 41 | # Compatibility: return INPUT filehandle | ||||||||||||
| 42 | 0 | ▶ | sub stdin { | ||||||||||
|
Subroutine
stdin: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 43 | 0 | my $obj = shift; | |||||||||||
| 44 | 0 | $obj->{INPUT}; | |||||||||||
| 45 | } | ||||||||||||
| 46 | |||||||||||||
| 47 | # Compatibility: setstdin method | ||||||||||||
| 48 | 0 | ▶ | sub setstdin { | ||||||||||
|
Subroutine
setstdin: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 49 | 0 | my $obj = shift; | |||||||||||
| 50 | 0 | $obj->with(stdin => shift); | |||||||||||
| 51 | } | ||||||||||||
| 52 | |||||||||||||
| 53 | 16 | 1; | |||||||||||
| 54 | |||||||||||||
| 55 | __END__ | ||||||||||||