4 # It is a very simple system in that you type in 'help <cmd>' and it
5 # looks for a file called <cmd>.hlp in either the local_cmd directory
6 # or the cmd directory (in that order).
8 # if you just type in 'help' by itself you get what is in 'help.hlp'.
10 # Copyright (c) 1998 - Dirk Koopman G1TLH
15 my ($self, $line) = @_;
17 my ($path, $fcmd) = ($main::cmd, "help");;
19 my @inpaths = ($main::localcmd, $main::cmd);
22 # this is naff but it will work for now
23 $line = "help" if !$line;
26 # each help file starts with a line that looks like:-
28 # === 0^EN^HELP^Description
33 # The fields are:- privilege level, Language, full command name, short description
36 if (!open(H, "$path/$fcmd.hlp")) {
37 return (1, "no help on $line available");
45 next if $in =~ /^\s*\#/;
50 my ($priv, $lang, $cmd, $desc) = split /\^/, $in;
51 next if $priv > $self->priv; # ignore subcommands that are of no concern
52 next if $self->lang && $self->lang ne $lang;
53 push @out, "$cmd - $desc";
57 push @out, $in if $include;
60 push @out, "No help available for $line" if @out == 0;