fixed sh/filter
[spider.git] / cmd / show / filter.pl
1 #
2 # show filter 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 wcy wwv);
26 }
27
28 my $key;
29 foreach $key (@in) {
30         my $ref = Filter::read_in($key, $call, 1);
31         push @out, $ref->print($call, $key, "input") if $ref;
32         $ref = Filter::read_in($key, $call, 0);
33         push @out, $ref->print($call, $key, "") if $ref;
34 }
35 push @out, $self->msg('filter3', $call) unless @out;
36 return (1, @out);