2 |
## $Id$ |
## $Id$ |
3 |
## ------------------------------------------------------------------------- |
## ------------------------------------------------------------------------- |
4 |
## $Log$ |
## $Log$ |
5 |
|
## Revision 1.9 2004/06/20 16:06:57 joko |
6 |
|
## sub start: little modification, now using targets-cache if available |
7 |
|
## |
8 |
|
## Revision 1.8 2003/12/05 04:59:33 joko |
9 |
|
## + minor update: disabled some unnecessary loggers |
10 |
|
## |
11 |
|
## Revision 1.7 2003/05/13 05:52:58 joko |
12 |
|
## minor update: modified description printing logic |
13 |
|
## |
14 |
## Revision 1.6 2003/03/29 07:08:56 joko |
## Revision 1.6 2003/03/29 07:08:56 joko |
15 |
## rap goes global: |
## rap goes global: |
16 |
## + distinguish between running in global- or project-mode |
## + distinguish between running in global- or project-mode |
227 |
use File::Spec::Functions qw( splitpath splitdir catpath catdir ); |
use File::Spec::Functions qw( splitpath splitdir catpath catdir ); |
228 |
|
|
229 |
|
|
230 |
|
# a package global topic registry |
231 |
|
our $registry; |
232 |
|
|
233 |
|
|
234 |
sub constructor { |
sub constructor { |
235 |
my $self = shift; |
my $self = shift; |
236 |
|
|
252 |
|
|
253 |
sub start { |
sub start { |
254 |
my $self = shift; |
my $self = shift; |
255 |
$self->log("starting", 'info'); |
#$self->log("starting", 'info'); |
256 |
|
|
257 |
$self->loadGlobalProperties(); |
$self->loadGlobalProperties(); |
258 |
|
$self->indexTargets({ load => 1 }); |
259 |
|
|
260 |
#print Dumper($self); |
#print Dumper($self); |
261 |
if (my $target = $self->{target}) { |
if (my $target = $self->{target}) { |
262 |
#$self->{targets}->{$target} = Data::Rap::Target->new( name => $target ); |
#$self->{targets}->{$target} = Data::Rap::Target->new( name => $target ); |
263 |
$self->log("target: $target", 'info'); |
#$self->log("target: $target", 'info'); |
264 |
$self->performTarget($target); |
$self->performTarget($target); |
265 |
} else { |
} else { |
266 |
my $meta_raw = $self->getTargetList(); |
my $meta_raw = $self->getTargetList(); |
267 |
|
|
268 |
|
my $maxlength = 0; |
269 |
|
map { |
270 |
|
my $len = length($_->{name}); |
271 |
|
$maxlength = $len if $len > $maxlength; |
272 |
|
} @$meta_raw; |
273 |
|
|
274 |
|
my $program = splitpath($0); |
275 |
foreach my $entry (@$meta_raw) { |
foreach my $entry (@$meta_raw) { |
276 |
print " - rap.pl $entry->{name}", "\n"; |
my $len = length($entry->{name}); |
277 |
print $entry->{description}, "\n" if $entry->{description}; |
#$len = ((1 / ($len / 8)) * 1.9); |
278 |
|
#$len = ((1 / ($maxlength - $len / 8)) * 1.9); |
279 |
|
$len = $maxlength - $len + 5; |
280 |
|
#print "len: $len", "\n"; |
281 |
|
# one line per target |
282 |
|
print "$program $entry->{name}", " " x $len; |
283 |
|
print $entry->{description} if $entry->{description}; |
284 |
|
print "\n"; |
285 |
|
# more lines per target |
286 |
|
#print "$program $entry->{name}", "\n"; |
287 |
|
#print " ", $entry->{description}, "\n" if $entry->{description}; |
288 |
} |
} |
289 |
|
|
290 |
return; |
return; |