fixed problem caused by moving the command execution into a separate
[spider.git] / cmd / show / station.pl
1 #
2 # show the station details
3 #
4 # Copyright (c) 1998 - Dirk Koopman G1TLH
5 #
6 # $Id$
7 #
8
9 my ($self, $line) = @_;
10 my @f = split /\s+/, uc $line;
11 my @out;
12 my $call;
13
14 if (@f == 0) {
15   return (1, "*** no station specified ***") if ($self->priv < 5); 
16   my @calls = DXUser::get_all_calls();
17   foreach $call (@calls) {
18     my $ref = DXUser->get_current($call);
19         next if !$ref;
20         my $sort = $ref->sort;
21         my $qth = $ref->qth;
22         my $home = $ref->node;
23     push @out, "$call $sort $qth $home";
24   }
25 } else {
26   foreach $call (@f) {
27     my $ref = DXUser->get_current($call);
28         if ($ref) {
29           my $name = $ref->name;  
30       my $qth = $ref->qth;
31           my $lat = $ref->lat;
32           my $long = $ref->long;
33           my $node = $ref->node;
34 #         my $homenode = $ref->homenode;
35           push @out, "$call $qth $lat $long $node";
36         } else {
37           push @out, "$call not known";
38         }
39   }
40 }
41
42 return (1, @out);