updated documentation a bit
[spider.git] / cmd / show / hops.pl
1 #
2 # show hops commands
3 #
4 # Copyright (c) 2000 Dirk Koopman G1TLH
5 #
6 # $Id$
7 #
8 my ($self, $line) = @_;
9 my @f = split /\s+/, $line;
10 my @out;
11 my $call = $self->call;
12
13 if (@f && $self->priv >= 8) {
14         if (is_callsign(uc $f[0])) {
15                 $call = uc shift @f;
16     } elsif ($f[0] eq 'node_default' || $f[0] eq 'user_default') {
17                 $call = shift @f;
18         }
19 }
20
21 my @in;
22 if (@f) {
23         push @in, @f;
24 } else {
25         push @in, qw(ann spots route wcy wwv);
26 }
27
28 my $sort;
29 foreach $sort (@in) {
30         my $ref = Filter::read_in($sort, $call, 0);
31         my $hops = $ref ? $ref->{hops} : undef;
32         push @out, $self->msg('sethop2', $hops, '', $sort, $call) if $hops;
33 }
34 push @out, $self->msg('sethop3', $call) unless @out;
35 return (1, @out);