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