X-Git-Url: http://dxcluster.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=cmd%2Fshow%2Fprefix.pl;h=df0f192c451632807d5bbbcb9ef7612ea2f3e40a;hb=8178d787d7cc8040fa8958197582bba5c80e6f59;hp=9273243504e0a7b6c73b782f68addfae4546c004;hpb=bdfc958f3d0fa912d20a020ac1a6cd2c79a22729;p=spider.git diff --git a/cmd/show/prefix.pl b/cmd/show/prefix.pl index 92732435..df0f192c 100644 --- a/cmd/show/prefix.pl +++ b/cmd/show/prefix.pl @@ -1,25 +1,28 @@ # -# show the dxcc number for each callsign or prefix entered +# show the prefix info for each callsign or prefix entered # # $Id$ # my ($self, $line) = @_; -my @list = split /\s+/, $line; # generate a list of callsigns +my @list = split /\s+/, $line; # generate a list of callsigns my $l; my @out; -print "line: $line\n"; +#print "line: $line\n"; foreach $l (@list) { - my @ans = Prefix::extract($l); - print "ans:", @ans, "\n"; - next if !@ans; - my $pre = shift @ans; - my $a; - foreach $a (@ans) { - push @out, sprintf "%s DXCC: %3d ITU: %3d CQ: %3d (%s, %s)", uc $l, $a->dxcc(), $a->itu(), $a->cq(), $pre, $a->name(); - } + my @ans = Prefix::extract($l); + next if !@ans; + my $pre = shift @ans; + my $a; + foreach $a (@ans) { + push @out, sprintf "%s DXCC: %d ITU: %d CQ: %d LL: %s %s (%s, %s)", uc $l, $a->dxcc, $a->itu, $a->cq, slat($a->lat), slong($a->long), $pre, $a->name; + $l = " " x length $l; + } + if ($ans[0]->state) { + push @out, sprintf "%s City: %s State: %s", $l, join (' ', map {ucfirst} split(/\s+/, lc $ans[0]->city)), $ans[0]->state; + } } return (1, @out);