4 # apropos - this does a grep on the command file and returns the commands
5 # that contain the string searched for
7 # Copyright (c) 1998 - Dirk Koopman G1TLH
12 my ($self, $line) = @_;
15 my $lang = $self->lang;
16 $lang = 'en' if !$lang;
18 my $h = new FileHandle;
20 if (!open($h, "$main::localcmd/Commands_$lang.hlp")) {
21 if (!open($h, "$main::cmd/Commands_$lang.hlp")) {
22 return (1, $self->msg('helpe1'));
27 $line =~ s/\W//og; # remove dubious characters
30 my ($priv, $cmd, $desc);
36 push @out, "$cmd $desc" if $include;
39 ($priv, $cmd, $desc) = split /\^/, $in;
40 next if $priv > $self->priv; # ignore subcommands that are of no concern
41 next unless $cmd =~ /$line/i || $desc =~ /$line/i;
42 next if $cmd =~ /-$/o;
46 $include =~ 1 if $cmd =~ /$line/i;
48 push @out, "$cmd $desc" if $include;
52 push @out, $self->msg('helpe2', $line) if @out == 0;