File Coverage

blib/lib/App/pscan/Command.pm
Criterion Covered Total %
statement 9 19 47.3
branch 0 4 0.0
condition n/a
subroutine 3 7 42.8
pod 0 4 0.0
total 12 34 35.2


line stmt bran cond sub pod time code
1             package App::pscan::Command;
2 1     1   8 use App::pscan;
  1         4  
  1         29  
3 1     1   5 use base qw(App::CLI App::CLI::Command);
  1         2  
  1         1088  
4              
5 1     1   28189 use constant global_options => ( 'help' => 'help' );
  1         3  
  1         238  
6              
7             sub alias { (
8 0     0 0   "t" => "tcp",
9             "u" => "udp",
10             "d" => "discover"
11              
12            
13             ) }
14              
15             sub invoke {
16 0     0 0   my ($pkg, $cmd, @args) = @_;
17 0           local *ARGV = [$cmd, @args];
18 0           my $ret = eval {
19 0           $pkg->dispatch();
20             };
21 0 0         if( $@ ) {
22 0           warn $@;
23             }
24             }
25              
26             sub run(){
27 0     0 0   my $self=shift;
28 0 0         $self->global_help if ($self->{help});
29             }
30              
31             sub global_help {
32 0     0 0   print <<'END';
33             App::pscan
34             ____________
35              
36             help (--help for full)
37             - show help message
38              
39             tcp [ip, iprange]:[port] (payload)
40             - try to send the payload
41              
42             udp [ip, iprange]:[port] (payload)
43             - try to send the payload
44              
45             discover [ip, iprange]
46             - try to discover hosts in the network
47              
48             END
49             }
50              
51             1;