947f70a4dd78e87d7758beef62ee516c9bcec86f
[spider.git] / cmd / show / badword.pl
1 #
2 # show list of bad dx callsigns
3 #
4 # Copyright (c) 1998 - Dirk Koopman G1TLH
5 #
6 #
7 #
8 my ($self, $line) = @_;
9 return (1, $self->msg('e5')) if $self->remotecmd;
10 # are we permitted?
11 return (1, $self->msg('e5')) if $self->priv < 6;
12 my @out;
13 my @l;
14 my $count = 0;
15
16 if ($line =~ /^\s*full/i) {
17         foreach my $w (BadWords::list_regex(1)) {
18                 ++$count;
19                 push @out, $w; 
20         }
21 }
22 else {
23         foreach my $w (BadWords::list_regex()) {
24                 ++$count;
25                 if (@l >= 5) {
26                         push @out, sprintf "%-12s %-12s %-12s %-12s %-12s", @l;
27                         @l = ();
28                 }
29                 push @l, $w;
30         }
31         push @l, "" while @l < 5;
32         push @out, sprintf "%-12s %-12s %-12s %-12s %-12s", @l;
33 }
34
35 push @out, "$count BadWords";
36         
37 return (1, @out);
38