X-Git-Url: http://gb7djk.dxcluster.net/gitweb/gitweb.cgi?a=blobdiff_plain;f=cmd%2Fhelp.pl;h=51dfa930a413d56e9e2900b10927dd5068fa602a;hb=a9cff23c7050696bfe1dee906157416c49739f07;hp=cf3dbd8b5a9e25a65f7e81c04bd596e060df8355;hpb=16b9415f38bf1b7eab1a9d2dc72abce9a643be09;p=spider.git diff --git a/cmd/help.pl b/cmd/help.pl index cf3dbd8b..51dfa930 100644 --- a/cmd/help.pl +++ b/cmd/help.pl @@ -14,7 +14,6 @@ my ($self, $line) = @_; my @out; # this is naff but it will work for now -$line = "help" if !$line; my $lang = $self->lang; $lang = 'en' if !$lang; @@ -35,16 +34,18 @@ $lang = 'en' if !$lang; my $h = new IO::File; if (!open($h, "$main::localcmd/Commands_$lang.hlp")) { + $lang = 'en'; if (!open($h, "$main::cmd/Commands_$lang.hlp")) { return (1, $self->msg('helpe1')); } } my $in; -$line =~ s/![\w\/]//og; -$line =~ s/\//\.\*\//og; -$line =~ s/^\s+//og; -$line =~ s/\s+$//og; +$line =~ s/[^\w\/]//g; +$line =~ s/\//\.\*\//g; +$line =~ s/^\s+//g; +$line =~ s/\s+$//g; +$line = "help" if $line =~ /^\s*$/; # sort out aliases my $alias = CmdAlias::get_hlp($line); @@ -59,7 +60,7 @@ foreach $in (<$h>) { $in =~ s/=== //; my ($priv, $cmd, $desc) = split /\^/, $in; next if $priv > $self->priv; # ignore subcommands that are of no concern - next unless $cmd =~ /$line/i; + next unless $cmd =~ /^$line/i; push @out, "$cmd $desc" unless $cmd =~ /-$/o; $state = 1; next;