4 # It is a very simple system in that you type in 'help <cmd>' and it
5 # looks for a file called command.hlp in either the local_cmd directory
6 # or the cmd directory (in that order).
8 # Copyright (c) 1998 - Dirk Koopman G1TLH
13 my ($self, $line) = @_;
16 # this is naff but it will work for now
17 my $lang = $self->lang;
18 $lang = 'en' if !$lang;
20 # each help file contains lines that looks like:-
22 # === 0^EN^*^Description
26 # === 0^EN^help^Description
31 # The fields are:- privilege level, Language, full command name, short description
36 if (!open($h, "$main::localcmd/Commands_$lang.hlp")) {
37 if (!open($h, "$main::cmd/Commands_$lang.hlp")) {
38 return (1, $self->msg('helpe1'));
43 $line =~ s/[^\w\/]//g;
44 $line =~ s/\//\.\*\//g;
47 $line = "help" if $line =~ /^\s*$/;
50 my $alias = CmdAlias::get_hlp($line);
51 $line = $alias if $alias;
58 last if $state == 2; # come out on next command
60 my ($priv, $cmd, $desc) = split /\^/, $in;
61 next if $priv > $self->priv; # ignore subcommands that are of no concern
62 next unless $cmd =~ /^$line/i;
63 push @out, "$cmd $desc" unless $cmd =~ /-$/o;
75 push @out, $self->msg('helpe2', $line) if @out == 0;