| 1 | #!perl | ||||||||||||||||||||
| 2 | 5 | ▶ | use 5.012; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 3 | 5 | ▶ | use warnings; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 4 | |||||||||||||||||||||
| 5 | # :squash-remove-start: | ||||||||||||||||||||
| 6 | 5 | ▶ | use FindBin; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 7 | 5 | ▶ | use lib "$FindBin::Bin/lib"; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 8 | # :squash-remove-end: | ||||||||||||||||||||
| 9 | |||||||||||||||||||||
| 10 | 5 | require Chicken::Ipsum; | |||||||||||||||||||
| 11 | |||||||||||||||||||||
| 12 | 5 | ▶ | if (($ARGV[0] // '') eq '--help') { | ||||||||||||||||||
|
Branch: 1 branch
Condition100%2/2
$ARGV[0] // ""
MC/DC100%1/1
$ARGV[0] // ""
$ARGV[0]
Truth table100%2/2
A
A= $ARGV[0]
| |||||||||||||||||||||
| 13 | 1 | print HELP_MESSAGE(); | |||||||||||||||||||
| 14 | 1 | exit 0; | |||||||||||||||||||
| 15 | } | ||||||||||||||||||||
| 16 | |||||||||||||||||||||
| 17 | 4 | ▶ | if (($ARGV[0] // '') eq '--version') { | ||||||||||||||||||
|
Branch: 1 branch
Condition100%2/2
$ARGV[0] // ""
MC/DC100%1/1
$ARGV[0] // ""
$ARGV[0]
Truth table100%2/2
A
A= $ARGV[0]
| |||||||||||||||||||||
| 18 | 1 | print VERSION_MESSAGE(); | |||||||||||||||||||
| 19 | 1 | exit 0; | |||||||||||||||||||
| 20 | } | ||||||||||||||||||||
| 21 | |||||||||||||||||||||
| 22 | 3 | ▶ | if (@ARGV > 1) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 23 | 0 | print STDERR USAGE(); | |||||||||||||||||||
| 24 | 0 | exit 2; | |||||||||||||||||||
| 25 | } | ||||||||||||||||||||
| 26 | |||||||||||||||||||||
| 27 | 3 | ▶ | my $num_paragraphs = int (shift // 1); | ||||||||||||||||||
|
Condition100%2/2
shift @ARGV // 1
MC/DC100%1/1
shift @ARGV // 1
shift @ARGV
Truth table100%2/2
A
A= shift @ARGV
| |||||||||||||||||||||
| 28 | 3 | say scalar Chicken::Ipsum->new->paragraphs($num_paragraphs); | |||||||||||||||||||
| 29 | |||||||||||||||||||||
| 30 | 1 | ▶ | sub USAGE { | ||||||||||||||||||
|
Subroutine
USAGE: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 31 | return <<'EOUSAGE' | ||||||||||||||||||||
| 32 | Usage: chicken-ipsum [NUM] | ||||||||||||||||||||
| 33 | EOUSAGE | ||||||||||||||||||||
| 34 | 1 | } | |||||||||||||||||||
| 35 | |||||||||||||||||||||
| 36 | 1 | ▶ | sub HELP_MESSAGE { | ||||||||||||||||||
|
Subroutine
HELP_MESSAGE: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 37 | 1 | return USAGE() . <<'EOHELP'; | |||||||||||||||||||
| 38 | Generate NUM paragraphs of random chicken noises (1 paragraph by default) | ||||||||||||||||||||
| 39 | |||||||||||||||||||||
| 40 | Options: | ||||||||||||||||||||
| 41 | --help Show this message | ||||||||||||||||||||
| 42 | --version Show version | ||||||||||||||||||||
| 43 | EOHELP | ||||||||||||||||||||
| 44 | } | ||||||||||||||||||||
| 45 | |||||||||||||||||||||
| 46 | 1 | ▶ | sub VERSION_MESSAGE { | ||||||||||||||||||
|
Subroutine
VERSION_MESSAGE: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 47 | 1 | return <<"EOVERSION"; | |||||||||||||||||||
| 48 | chicken-ipsum (Chicken::Ipsum) $Chicken::Ipsum::VERSION | ||||||||||||||||||||
| 49 | EOVERSION | ||||||||||||||||||||
| 50 | } | ||||||||||||||||||||