| 1 | package App::PRT::Command::ListFiles; | ||||||||||||||||||||||||||||
| 2 | # Created by CXW based on App::PRT::Command::RenameClass | ||||||||||||||||||||||||||||
| 3 | |||||||||||||||||||||||||||||
| 4 | 1 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 5 | 1 | ▶ | use warnings; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 6 | 1 | ▶ | use Path::Class; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 7 | |||||||||||||||||||||||||||||
| 8 | 3 | ▶ | sub new { | ||||||||||||||||||||||||||
|
Subroutine
new: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||
| 9 | 3 | my ($class) = @_; | |||||||||||||||||||||||||||
| 10 | 3 | bless {eol => "\n"}, $class; | |||||||||||||||||||||||||||
| 11 | } | ||||||||||||||||||||||||||||
| 12 | |||||||||||||||||||||||||||||
| 13 | # parse arguments from CLI. The only argument is `-0`, to output | ||||||||||||||||||||||||||||
| 14 | # filenames separated by "\0" instead of "\n". | ||||||||||||||||||||||||||||
| 15 | # arguments: | ||||||||||||||||||||||||||||
| 16 | # @arguments | ||||||||||||||||||||||||||||
| 17 | # returns: | ||||||||||||||||||||||||||||
| 18 | # @rest_arguments | ||||||||||||||||||||||||||||
| 19 | 2 | ▶ | sub parse_arguments { | ||||||||||||||||||||||||||
|
Subroutine
parse_arguments: called CC=3 SCAR=11.0
Pod
undocumented
| |||||||||||||||||||||||||||||
| 20 | 2 | my ($self, @arguments) = @_; | |||||||||||||||||||||||||||
| 21 | |||||||||||||||||||||||||||||
| 22 | 2 | ▶ | if(@arguments && $arguments[0] eq '-0') { | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
@arguments and $arguments[0] eq "-0"
MC/DC50%1/2
@arguments and $arguments[0] eq "-0"
@arguments
$arguments[0] eq "-0"
Truth table66%2/3
A and B
A= @argumentsB= $arguments[0] eq "-0"
| |||||||||||||||||||||||||||||
| 23 | 1 | shift @arguments; | |||||||||||||||||||||||||||
| 24 | 1 | $self->{eol} = "\0"; | |||||||||||||||||||||||||||
| 25 | } | ||||||||||||||||||||||||||||
| 26 | |||||||||||||||||||||||||||||
| 27 | 2 | @arguments; | |||||||||||||||||||||||||||
| 28 | } | ||||||||||||||||||||||||||||
| 29 | |||||||||||||||||||||||||||||
| 30 | # Output the filename. | ||||||||||||||||||||||||||||
| 31 | # arguments: | ||||||||||||||||||||||||||||
| 32 | # $file: filename | ||||||||||||||||||||||||||||
| 33 | 2 | ▶ | sub execute { | ||||||||||||||||||||||||||
|
Subroutine
execute: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||
| 34 | 2 | my ($self, $file) = @_; | |||||||||||||||||||||||||||
| 35 | 2 | print file($file), $self->{eol}; | |||||||||||||||||||||||||||
| 36 | # Extra file() call to canonicalize | ||||||||||||||||||||||||||||
| 37 | } | ||||||||||||||||||||||||||||
| 38 | |||||||||||||||||||||||||||||
| 39 | 1 | 1; | |||||||||||||||||||||||||||