46d641edf1430f81cd234284425fdf3a584f9f45
[spider.git] / cmd / show / users.pl
1 #
2 # show the users on this cluster from the routing tables
3 #
4 # Copyright (c) 1998 Dirk Koopman G1TLH
5 #
6 # $Id$
7 #
8
9 my ($self, $line) = @_;
10 my @list = map { uc } split /\s+/, $line; # list of callsigns of nodes
11 my @out;
12 my $node = $main::routeroot;
13
14 push @out, "Callsigns connected to $main::mycall";
15 my $call;
16 my $i = 0;
17 my @l;
18 my @val = sort $node->users;
19 foreach $call (@val) {
20         if (@list) {
21                 next if !grep $call eq $_, @list;
22         } 
23         if ($i >= 5) {
24                 push @out, sprintf "%-12s %-12s %-12s %-12s %-12s %-12s", @l;
25                 @l = ();
26                 $i = 0;
27         }
28         my $uref = Route::User::get($call);
29         my $s = $call;
30         if ($uref) {
31                 $s = sprintf "(%s)", $call unless $uref->here;
32         } else {
33                 $s = "$call?";
34         }
35         push @l, $s;
36         $i++;
37 }
38 push @out, sprintf "%-12s %-12s %-12s %-12s %-12s %-12s", @l;
39
40
41 return (1, @out);
42