change interface to Route::findroutes
[spider.git] / cmd / show / route.pl
index 45214003ac22165ebfefc2079935b5e4ba257113..d055e61694a01995f9245395fc42651545917bcc 100644 (file)
@@ -3,7 +3,7 @@
 #
 # Copyright (c) 2001 Dirk Koopman G1TLH
 #
-# $Id$
+#
 #
 
 my ($self, $line) = @_;
@@ -16,9 +16,10 @@ my $l;
 foreach $l (@list) {
        my $ref = Route::get($l);
        if ($ref) {
-               my $parents = join ',', $ref->parents;
-               my $dxchan = $ref->dxchan;
-               push @out, $self->msg('route', $l, $parents,  $dxchan->call);
+               my $parents = $ref->isa('Route::Node') ? $l : join(',', $ref->parents);
+               my @n = map { $_->[1]->call . '(' .  (100 - $_->[0]) . ')' } Route::findroutes($l);
+               @n = @n[0,1,2,3],'...' if @n > 4;
+               push @out, $self->msg('route', $l, $parents,  join(',', @n));
        } else {
                push @out, $self->msg('e7', $l);
        }