added french changes
[spider.git] / cmd / show / station.pl
index 4aadd22292e7c1f2536001108263d9bf390f07b2..a5ffe2adc01f9e8f651da739982a10134dab5b46 100644 (file)
@@ -11,10 +11,20 @@ my @f = split /\s+/, uc $line;
 my @out;
 my $call;
 my $seek;
+push @f, $self->call unless @f;
 
-if (@f == 0) {
-       return (1, $self->msg('e6')) if ($self->priv < 5); 
-       my @calls = DXUser::get_all_calls();
+if (@f <= 2 && uc $f[0] eq 'ALL') {
+       return (1, $self->msg('e6')) if @f == 1 && $self->priv < 6; 
+       return (1, $self->msg('e6')) if $self->priv < 5 || $f[1] eq '*'; 
+       shift @f;
+       my $exp = shellregex(uc shift @f) if @f; 
+       my @calls;
+       if ($exp) {
+               @calls = grep {m{$exp}} DXUser::get_all_calls();
+    } else {
+               @calls = DXUser::get_all_calls();
+       }
+       
        foreach $call (@calls) {
                my $ref = DXUser->get_current($call);
                next if !$ref;
@@ -59,21 +69,20 @@ if (@f == 0) {
                                $miles = $dx * 0.62133785;
                        }
                        
-                       my $cref = DXCluster->get_exact($call);
-                       $cref = DXCluster->get($call) unless $cref;
-                       my $seek = $cref->mynode->call if $cref;
+                       my $cref = Route::get($call);
+                       my $seek = $cref->isa('Route::Node') ? $call : join(',', $cref->parents) if $cref;
 
                        if ($seek) {
-                               push @out, "User         : $call (at $seek)";
+                               push @out, sprintf("%-13s: %s (%s %s)", $self->msg('user'), $call, $self->msg('at'), $seek);
                        } else {
-                               push @out, "User         : $call";
+                               push @out, sprintf("%-13s: %s", $self->msg('user'), $call);
                        }
-                       push @out, "Name         : $name" if $name;
-                       push @out, "Last Connect : $last" if $last;
-                       push @out, "QTH          : $qth" if $qth;
-                       push @out, "Location     : $latlong ($qra)" if $latlong || $qra ;
-                       push @out, sprintf("Heading      : %.0f Deg %.0f Mi. %.0f Km.", $bearing, $miles, $dx) if $latlong;
-                       push @out, "Home Node    : $homenode" if $homenode;
+                       push @out, sprintf("%-13s: %s", $self->msg('name1'), $name) if $name;
+                       push @out, sprintf("%-13s: %s", $self->msg('lastconn'), $last) if $last;
+                       push @out, sprintf("%-13s: %s", 'QTH', $qth) if $qth;
+                       push @out, sprintf("%-13s: %s", $self->msg('location'), "$latlong ($qra)") if $latlong || $qra ;
+                       push @out, sprintf("%-13s: %.0f Deg. %.0f Mi. %.0f Km.", $self->msg('heading'), $bearing, $miles, $dx) if $latlong;
+                       push @out, sprintf("%-13s: %s", $self->msg('homenode2'), $homenode) if $homenode;
                } else {
                        push @out, $self->msg('usernf', $call);
                }