tweeked the band handling a touch to see bands with more than one part
[spider.git] / cmd / show / bands.pl
1 #
2 # display the band data
3 #
4
5 #$DB::single = 1;
6
7 my ($self, $line) = @_;
8 my @f = split /\s+/, $line;
9 my @bands;
10 my $band;
11 my @out;
12 my $i;
13
14 if (!$line) {
15   @bands = sort { Bands::get($a)->band->[0] <=> Bands::get($b)->band->[0] } Bands::get_keys();
16   push @out, "Bands Available:-";
17   foreach $band (@bands) {
18     my $ref = Bands::get($band)->band;
19     my $s = sprintf "%10s: ", $band;
20     for ($i = 0; $i < $#{$ref}; $i += 2) {
21       my $from = $ref->[$i];
22       my $to = $ref->[$i+1];
23       $s .= ", " if $i;
24       $s .= "$from -> $to";
25     }
26     push @out, $s;
27   } 
28   push @out, "Regions Available:-";
29   @bands = Bands::get_region_keys();
30   foreach $band (@bands) {
31     my $ref = Bands::get_region($band);
32     my $s = sprintf("%10s: ", $band ) . join(' ', @{$ref}); 
33     push @out, $s;
34   }
35 }
36
37 return (1, @out);