tidy up Route, add argument to sh/ver
[spider.git] / cmd / stat / route.pl
1 #
2 # show a Route thingy
3 #
4 # Copyright (c) 2020 Dirk Koopman G1TLH
5 #
6 # A general purpose Route get thingy, use stat/route_user or _node if
7 # you want a list of all that particular type of thingy otherwise this
8 # is likely to be less typing and will dwym.
9 #
10
11 my ($self, $line) = @_;
12 my @out;
13 my @list = split /\s+/, $line;                # generate a list of callsigns
14
15 push @list, $self->call unless @list;
16
17 foreach my $call (@list) {
18   $call = uc $call;
19   my $ref = Route::get($call);
20   if ($ref) {
21     push @out, print_all_fields($self, $ref, "Route::User Information $call");
22   } else {
23     push @out, "Route: $call not found";
24   }
25   push @out, "" if @list > 1;
26 }
27
28 return (1, @out);