line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Task::Pluggable::CommandLineTaskManager; |
2
|
1
|
|
|
1
|
|
7
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
43
|
|
3
|
1
|
|
|
1
|
|
7
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
36
|
|
4
|
1
|
|
|
1
|
|
1227
|
use Term::ANSIColor qw(:constants); |
|
1
|
|
|
|
|
9885
|
|
|
1
|
|
|
|
|
947
|
|
5
|
|
|
|
|
|
|
$Term::ANSIColor::AUTORESET = 1; |
6
|
1
|
|
|
1
|
|
11
|
use base qw(Task::Pluggable::AbstractTaskManager); |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
805
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
sub load_args{ |
9
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
10
|
0
|
|
|
|
|
|
$self->task_name(shift @ARGV); |
11
|
0
|
|
|
|
|
|
$self->args(\@ARGV); |
12
|
|
|
|
|
|
|
} |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub help{ |
15
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
16
|
0
|
|
|
|
|
|
print <<__END_HELP_HEADER__; |
17
|
|
|
|
|
|
|
Perl Task Manager |
18
|
|
|
|
|
|
|
usage: |
19
|
|
|
|
|
|
|
ptm .. |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
tasklist: |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
__END_HELP_HEADER__ |
24
|
0
|
|
|
|
|
|
foreach my $task_name (sort{ $a cmp $b } keys %{$self->tasks}){ |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
25
|
0
|
|
|
|
|
|
print ' '; |
26
|
0
|
|
|
|
|
|
print BOLD GREEN sprintf('%-15s',$task_name); |
27
|
0
|
|
|
|
|
|
print ' '; |
28
|
0
|
|
|
|
|
|
print WHITE $self->tasks()->{$task_name}->task_description()."\n"; |
29
|
0
|
0
|
|
|
|
|
if($self->tasks()->{$task_name}->task_args_description()){ |
30
|
0
|
|
|
|
|
|
printf(' %-15s ',''); |
31
|
0
|
|
|
|
|
|
print sprintf('%-15s',$self->tasks()->{$task_name}->task_args_description())."\n"; |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
0
|
|
|
|
|
|
print <<__END_HELP_FOOTER__; |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
__END_HELP_FOOTER__ |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
1; |