X-Git-Url: http://dxcluster.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=cmd%2Fhelp.pl;fp=cmd%2Fhelp.pl;h=cf3dbd8b5a9e25a65f7e81c04bd596e060df8355;hb=16b9415f38bf1b7eab1a9d2dc72abce9a643be09;hp=afdd2d302df66cc0d14db4c1dba93ba20b3eaf0d;hpb=c5c8e14ce61160f8dd54ddcf6f41a885f51a373d;p=spider.git diff --git a/cmd/help.pl b/cmd/help.pl index afdd2d30..cf3dbd8b 100644 --- a/cmd/help.pl +++ b/cmd/help.pl @@ -50,21 +50,24 @@ $line =~ s/\s+$//og; my $alias = CmdAlias::get_hlp($line); $line = $alias if $alias; -my $include; +my $state = 0; foreach $in (<$h>) { next if $in =~ /^\#/; chomp $in; if ($in =~ /^===/) { - $include = 0; + last if $state == 2; # come out on next command $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; push @out, "$cmd $desc" unless $cmd =~ /-$/o; - $include = 1; + $state = 1; next; } - push @out, " $in" if $include; + if ($state > 0) { + push @out, " $in"; + $state = 2; + } } close($h);