12Jul07=======================================================================
1. Change disconnection code so that nodes that are no longer routable are
(all) cleared out.
+2. Add help for sh/band and also allow query of individual band or regions.
11Jul07=======================================================================
1. improve speed of sh/c/n
2. remove all $Id$ strings from cmd tree
Display all the bad words in the system, see SET/BADWORD
for more information.
+=== 0^SHOW/BANDS [band|region names]^Show the list of bands and regions
+Display the bands and regions (collections of bands) known to
+the system. If you supply band or region names to SHOW/BANDS,
+the command will display just those bands or regions, e.g.:
+
+ sh/band
+ sh/band 2m hf
+
=== 0^SHOW/BUDDY^Show your list of buddies
See SET/BUDDY for more information about buddies.
#
#
-#$DB::single = 1;
+$DB::single = 1;
my ($self, $line) = @_;
my @f = split /\s+/, $line;
-my @bands;
+my @bands = grep {Bands::get($_)?$_:()} @f;
+my @regs = grep {Bands::get_region($_)?$_:()} @f;
my $band;
my @out;
my $i;
-if (!$line) {
- @bands = sort { Bands::get($a)->band->[0] <=> Bands::get($b)->band->[0] } Bands::get_keys();
+unless (@f) {
+ @bands = Bands::get_keys();
+ @regs = Bands::get_region_keys();
+}
+if (@bands) {
+ @bands = sort { Bands::get($a)->band->[0] <=> Bands::get($b)->band->[0] } @bands;
push @out, "Bands Available:-";
- foreach $band (@bands) {
- my $ref = Bands::get($band)->band;
- my $s = sprintf "%10s: ", $band;
- for ($i = 0; $i < $#{$ref}; $i += 2) {
+ foreach my $name (@bands) {
+ my $band = Bands::get($name);
+ my $ref = $band->band;
+ my $s = sprintf "%10s: ", $name;
+ for ($i = 0; $i < @$ref; $i += 2) {
my $from = $ref->[$i];
my $to = $ref->[$i+1];
$s .= ", " if $i;
$s .= "$from -> $to";
}
push @out, $s;
- }
+ }
+}
+
+if (@regs) {
push @out, "Regions Available:-";
- @bands = Bands::get_region_keys();
- foreach $band (@bands) {
- my $ref = Bands::get_region($band);
- my $s = sprintf("%10s: ", $band ) . join(' ', @{$ref});
+ @regs = sort @regs;
+ foreach my $region (@regs) {
+ my $ref = Bands::get_region($region);
+ my $s = sprintf("%10s: ", $region ) . join(' ', @{$ref});
push @out, $s;
}
}