add the possibility to search for a string in sh/cmd
[spider.git] / cmd / show / cmd_cache.pl
index bd26c7d88dfd103ba4d7b7050f33f102b308f1fe..25321e9a66f502640ebd835c7b3524b5b409b7ab 100644 (file)
@@ -8,10 +8,12 @@
 #
 
 my $self = shift;
+my $line = shift;
 return (1, $self->msg('e5')) if $self->priv < 9;
 
 my @out = sprintf "%-20s %s", "Command", "Path";
 for (sort keys %cmd_cache) {
+       next if $line && $_ !~ m|\Q$line|i;
        my $v = $cmd_cache{$_};
        $v =~ s|,|/|g;
        push @out, sprintf "%-20s %s", $_, "$v.pl";