| 2 |
## $Id$ |
## $Id$ |
| 3 |
## ------------------------------------------------------------------------- |
## ------------------------------------------------------------------------- |
| 4 |
## $Log$ |
## $Log$ |
| 5 |
|
## Revision 1.7 2003/05/13 05:52:58 joko |
| 6 |
|
## minor update: modified description printing logic |
| 7 |
|
## |
| 8 |
## Revision 1.6 2003/03/29 07:08:56 joko |
## Revision 1.6 2003/03/29 07:08:56 joko |
| 9 |
## rap goes global: |
## rap goes global: |
| 10 |
## + distinguish between running in global- or project-mode |
## + distinguish between running in global- or project-mode |
| 221 |
use File::Spec::Functions qw( splitpath splitdir catpath catdir ); |
use File::Spec::Functions qw( splitpath splitdir catpath catdir ); |
| 222 |
|
|
| 223 |
|
|
| 224 |
|
# a package global topic registry |
| 225 |
|
our $registry; |
| 226 |
|
|
| 227 |
|
|
| 228 |
sub constructor { |
sub constructor { |
| 229 |
my $self = shift; |
my $self = shift; |
| 230 |
|
|
| 258 |
} else { |
} else { |
| 259 |
my $meta_raw = $self->getTargetList(); |
my $meta_raw = $self->getTargetList(); |
| 260 |
|
|
| 261 |
|
my $maxlength = 0; |
| 262 |
|
map { |
| 263 |
|
my $len = length($_->{name}); |
| 264 |
|
$maxlength = $len if $len > $maxlength; |
| 265 |
|
} @$meta_raw; |
| 266 |
|
|
| 267 |
|
my $program = splitpath($0); |
| 268 |
foreach my $entry (@$meta_raw) { |
foreach my $entry (@$meta_raw) { |
| 269 |
print " - rap.pl $entry->{name}", "\n"; |
my $len = length($entry->{name}); |
| 270 |
print $entry->{description}, "\n" if $entry->{description}; |
#$len = ((1 / ($len / 8)) * 1.9); |
| 271 |
|
#$len = ((1 / ($maxlength - $len / 8)) * 1.9); |
| 272 |
|
$len = $maxlength - $len + 5; |
| 273 |
|
#print "len: $len", "\n"; |
| 274 |
|
# one line per target |
| 275 |
|
print "$program $entry->{name}", " " x $len; |
| 276 |
|
print $entry->{description} if $entry->{description}; |
| 277 |
|
print "\n"; |
| 278 |
|
# more lines per target |
| 279 |
|
#print "$program $entry->{name}", "\n"; |
| 280 |
|
#print " ", $entry->{description}, "\n" if $entry->{description}; |
| 281 |
} |
} |
| 282 |
|
|
| 283 |
return; |
return; |