Add a ring buffer to debugging + other things
[spider.git] / cmd / show / cmd_cache.pl
1 #
2 # show the contents and paths of any commands in the cmd_cache
3 #
4 # This will tell you whether you are using the version of the command
5 # that you think you are...
6 #
7 # Copyright (c) 2007 Dirk Koopman G1TLH
8 #
9
10 my $self = shift;
11 my $line = shift;
12 return (1, $self->msg('e5')) if $self->priv < 9;
13
14 my @out = sprintf "%-20s %s", "Command", "Path";
15 for (sort keys %DXCommandmode::cmd_cache) {
16         next if $line && $_ !~ m|\Q$line|i;
17         my $v = $DXCommandmode::cmd_cache{$_};
18         $v =~ s|,|/|g;
19         push @out, sprintf "%-20s %s", $_, "$v.pl";
20 }
21
22 return (1, @out);