X-Git-Url: http://gb7djk.dxcluster.net/gitweb/gitweb.cgi?a=blobdiff_plain;f=cmd%2Fshow%2Fconfiguration.pl;h=7c3281eadb8f193818ec555ee678d580ff69c163;hb=4a9c1e3fabd9931b914307ee4f79e7259b8cdfd6;hp=cb9f1946297d79179a720c10f675fb23016cc7ee;hpb=1256794cae0d863c829011df3f87dc1fb70f977d;p=spider.git diff --git a/cmd/show/configuration.pl b/cmd/show/configuration.pl index cb9f1946..7c3281ea 100644 --- a/cmd/show/configuration.pl +++ b/cmd/show/configuration.pl @@ -14,7 +14,7 @@ my $node; my @l; my @val; -push @out, "Node Callsigns"; +push @out, $self->msg('showconf'); if ($list[0] && $list[0] =~ /^NOD/) { my @ch = sort {$a->call cmp $b->call} DXChannel::get_all_nodes(); my $dxchan; @@ -27,27 +27,34 @@ if ($list[0] && $list[0] =~ /^NOD/) { $call = "($call)" unless $dxchan->here; push @l, $call; - my $i = 0; foreach my $ref (@val) { - if ($i >= 5) { + if (@l >= 6) { push @out, sprintf "%-12s %-12s %-12s %-12s %-12s %-12s", @l; @l = (); push @l, ""; - $i = 0; } my $s = $ref->call; $s ||= '???'; $s = sprintf "(%s)", $s unless $ref->here; push @l, $s; - $i++; } - push @l, "" while ($i++ < 5); + push @l, "" while @l < 6; push @out, sprintf "%-12s %-12s %-12s %-12s %-12s %-12s", @l; } } else { + my $printall; + + $printall = 1 if @list && $list[0] =~ /^ALL/i; + # build up the screen from the Node table foreach $node (@nodes) { - next if scalar @list && !grep $node->call =~ /^$_/, @list; + unless ($printall) { + if (@list) { + next unless grep $node->call =~ /^$_/, @list; + } else { + next unless grep $node->dxcc == $_, @main::my_cc; + } + } my $call = $node->call; @l = (); $call ||= '???'; @@ -55,16 +62,14 @@ if ($list[0] && $list[0] =~ /^NOD/) { push @l, $call; @val = sort $node->users; - my $i = 0; if (@val == 0 && $node->usercount) { push @l, sprintf "(%d users)", $node->usercount; } foreach $call (@val) { - if ($i >= 5) { + if (@l >= 6) { push @out, sprintf "%-12s %-12s %-12s %-12s %-12s %-12s", @l; @l = (); push @l, ""; - $i = 0; } my $uref = Route::User::get($call); my $s = $call; @@ -74,9 +79,8 @@ if ($list[0] && $list[0] =~ /^NOD/) { $s = "$call?"; } push @l, $s; - $i++; } - push @l, "" while ($i++ < 5); + push @l, "" while @l < 6; push @out, sprintf "%-12s %-12s %-12s %-12s %-12s %-12s", @l; } }