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;
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 = 'help' unless $line;
28 $line =~ s/\W//og; # remove dubious characters
31 my ($priv, $cmd, $desc);
37 push @out, "$cmd $desc" if $include;
40 ($priv, $cmd, $desc) = split /\^/, $in;
41 next if $priv > $self->priv; # ignore subcommands that are of no concern
42 next unless $cmd =~ /$line/i || $desc =~ /$line/i;
43 next if $cmd =~ /-$/o;
47 $include =~ 1 if $cmd =~ /$line/i;
49 push @out, "$cmd $desc" if $include;
53 push @out, $self->msg('helpe2', $line) if @out == 0;