/[cvs]/nfo/perl/libs/Data/Rap.pm
ViewVC logotype

Diff of /nfo/perl/libs/Data/Rap.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.6 by joko, Sat Mar 29 07:08:56 2003 UTC revision 1.7 by joko, Tue May 13 05:52:58 2003 UTC
# Line 2  Line 2 
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
# Line 218  use Cwd; Line 221  use Cwd;
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        
# Line 251  sub start { Line 258  sub start {
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;

Legend:
Removed from v.1.6  
changed lines
  Added in v.1.7

MailToCvsAdmin">MailToCvsAdmin
ViewVC Help
Powered by ViewVC 1.1.26 RSS 2.0 feed