File Coverage

hack.exe.in
Criterion Covered Total %
statement 25 25 100.0
branch 6 6 100.0
condition 4 4 100.0
subroutine 7 7 100.0
pod n/a
total 42 42 100.0


line stmt bran cond sub pod time code
1             #!/usr/bin/perl
2 5     5   27568 use 5.012;
  5         20  
3 5     5   27 use warnings;
  5         8  
  5         306  
4              
5             # :squash-remove-start:
6 5     5   2580 use FindBin qw//;
  5         7815  
  5         326  
7 5     5   2846 use lib "$FindBin::RealBin/lib";
  5         4703  
  5         37  
8             # :squash-remove-end:
9              
10 5         947153 require App::Hack::Exe;
11              
12 5 100 100     45 if (($ARGV[0] // '') eq '--help') {
13 1         5 print HELP_MESSAGE();
14 1         0 exit 0;
15             }
16              
17 4 100 100     20 if (($ARGV[0] // '') eq '--version') {
18 1         4 print VERSION_MESSAGE();
19 1         0 exit 0;
20             }
21              
22 3 100       14 if (@ARGV != 1) {
23 2         8 print STDERR USAGE();
24 2         0 exit 2;
25             }
26              
27             sub USAGE {
28             return <<'EOUSAGE'
29             Usage: hack.exe HOSTNAME
30             EOUSAGE
31 3     3   55 }
32              
33             sub HELP_MESSAGE {
34 1     1   2 return USAGE() . <<'EOHELP';
35             An animated terminal app that pretends to hack a website, just like in the movies
36              
37             Options:
38             --help Show this message
39             --version Show version
40             EOHELP
41             }
42              
43             sub VERSION_MESSAGE {
44 1     1   11 return <<"EOVERSION";
45             hack.exe (App::Hack::Exe) $App::Hack::Exe::VERSION
46             EOVERSION
47             }
48              
49 1         4 App::Hack::Exe->new->run(@ARGV);