mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-03-10 09:16:53 +00:00
98_help.pm: support ModuleName to find help text
git-svn-id: https://svn.fhem.de/fhem/trunk@8139 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
68259c8e2f
commit
f3d5a4cb4f
@ -1,4 +1,4 @@
|
|||||||
# $Id$
|
# $Id: 98_help.pm 8129 2015-03-01 20:29:21Z betateilchen $
|
||||||
#
|
#
|
||||||
package main;
|
package main;
|
||||||
use strict;
|
use strict;
|
||||||
@ -37,6 +37,8 @@ sub CommandHelp {
|
|||||||
my %mods;
|
my %mods;
|
||||||
my @modDir = ("$modPath/FHEM");
|
my @modDir = ("$modPath/FHEM");
|
||||||
|
|
||||||
|
$mod = $cmds{$mod}{ModuleName} if defined($cmds{$mod}{ModuleName});
|
||||||
|
|
||||||
foreach my $modDir (@modDir) {
|
foreach my $modDir (@modDir) {
|
||||||
eval { opendir(DH, $modDir); }; # || die "Cant open $modDir: $!\n";
|
eval { opendir(DH, $modDir); }; # || die "Cant open $modDir: $!\n";
|
||||||
while(my $l = readdir DH) {
|
while(my $l = readdir DH) {
|
||||||
@ -84,12 +86,6 @@ sub CommandHelp {
|
|||||||
if( $cl && $cl->{TYPE} eq 'telnet' ) {
|
if( $cl && $cl->{TYPE} eq 'telnet' ) {
|
||||||
$output =~ s/<br>/\n/g;
|
$output =~ s/<br>/\n/g;
|
||||||
$output =~ s/<br\/>/\n/g;
|
$output =~ s/<br\/>/\n/g;
|
||||||
$output =~ s/<table>//g;
|
|
||||||
$output =~ s/<\/table>//g;
|
|
||||||
$output =~ s/<t.>//g;
|
|
||||||
$output =~ s/<\/t.>//g;
|
|
||||||
$output =~ s/<h.>//g;
|
|
||||||
$output =~ s/<\/h.>//g;
|
|
||||||
$output =~ s/<a href.*\/a>//g;
|
$output =~ s/<a href.*\/a>//g;
|
||||||
$output =~ s/<a name.*\/a>//g;
|
$output =~ s/<a name.*\/a>//g;
|
||||||
$output =~ s/<ul>/\n/g;
|
$output =~ s/<ul>/\n/g;
|
||||||
@ -133,8 +129,8 @@ sub CommandHelp {
|
|||||||
next if($cl && $cmds{$cmd}{ClientFilter} &&
|
next if($cl && $cmds{$cmd}{ClientFilter} &&
|
||||||
$cl->{TYPE} !~ m/$cmds{$cmd}{ClientFilter}/);
|
$cl->{TYPE} !~ m/$cmds{$cmd}{ClientFilter}/);
|
||||||
my @a = split(",", $cmds{$cmd}{Hlp}, 2);
|
my @a = split(",", $cmds{$cmd}{Hlp}, 2);
|
||||||
# $a[0] =~ s/</</g;
|
$a[0] =~ s/</</g;
|
||||||
# $a[0] =~ s/>/>/g;
|
$a[0] =~ s/>/>/g;
|
||||||
$a[1] //= "";
|
$a[1] //= "";
|
||||||
$a[1] = " $a[1]";
|
$a[1] = " $a[1]";
|
||||||
$a[1] =~ s/</</g;
|
$a[1] =~ s/</</g;
|
||||||
@ -144,6 +140,27 @@ sub CommandHelp {
|
|||||||
|
|
||||||
return $str;
|
return $str;
|
||||||
|
|
||||||
|
# my $str = "<html><pre>Possible commands:<br/><br/>" .
|
||||||
|
# "Command Parameter<br/>" .
|
||||||
|
# " Description<br/>" .
|
||||||
|
# "----------------------------------------------------------------------<br/>";
|
||||||
|
#
|
||||||
|
# for my $cmd (sort keys %cmds) {
|
||||||
|
# next if(!$cmds{$cmd}{Hlp});
|
||||||
|
# next if($cl && $cmds{$cmd}{ClientFilter} &&
|
||||||
|
# $cl->{TYPE} !~ m/$cmds{$cmd}{ClientFilter}/);
|
||||||
|
# my @a = split(",", $cmds{$cmd}{Hlp}, 2);
|
||||||
|
# $a[0] =~ s/</</g;
|
||||||
|
# $a[0] =~ s/>/>/g;
|
||||||
|
# $a[1] //= "";
|
||||||
|
# $a[1] = " $a[1]";
|
||||||
|
# $a[1] =~ s/</</g;
|
||||||
|
# $a[1] =~ s/>/>/g;
|
||||||
|
# $str .= sprintf("%-15s%-50s<br/>%s<br/>", $cmd, $a[0], $a[1]);
|
||||||
|
# }
|
||||||
|
#
|
||||||
|
# return "$str</pre></html>";
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user