From f3d5a4cb4fd5443d02c93e228cc5029d0fa45734 Mon Sep 17 00:00:00 2001 From: betateilchen <> Date: Mon, 2 Mar 2015 19:53:06 +0000 Subject: [PATCH] 98_help.pm: support ModuleName to find help text git-svn-id: https://svn.fhem.de/fhem/trunk@8139 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/FHEM/98_help.pm | 35 ++++++++++++++++++++++++++--------- 1 file changed, 26 insertions(+), 9 deletions(-) diff --git a/fhem/FHEM/98_help.pm b/fhem/FHEM/98_help.pm index 659a40a5b..60d8d908c 100644 --- a/fhem/FHEM/98_help.pm +++ b/fhem/FHEM/98_help.pm @@ -1,4 +1,4 @@ -# $Id$ +# $Id: 98_help.pm 8129 2015-03-01 20:29:21Z betateilchen $ # package main; use strict; @@ -37,6 +37,8 @@ sub CommandHelp { my %mods; my @modDir = ("$modPath/FHEM"); + $mod = $cmds{$mod}{ModuleName} if defined($cmds{$mod}{ModuleName}); + foreach my $modDir (@modDir) { eval { opendir(DH, $modDir); }; # || die "Cant open $modDir: $!\n"; while(my $l = readdir DH) { @@ -84,12 +86,6 @@ sub CommandHelp { if( $cl && $cl->{TYPE} eq 'telnet' ) { $output =~ s/
/\n/g; $output =~ s//\n/g; - $output =~ s///g; - $output =~ s/<\/table>//g; - $output =~ s///g; - $output =~ s/<\/t.>//g; - $output =~ s///g; - $output =~ s/<\/h.>//g; $output =~ s///g; $output =~ s///g; $output =~ s/
    /\n/g; @@ -133,8 +129,8 @@ sub CommandHelp { 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/
    Possible commands:

    " . +# "Command Parameter
    " . +# " Description
    " . +# "----------------------------------------------------------------------
    "; +# +# 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[1] //= ""; +# $a[1] = " $a[1]"; +# $a[1] =~ s//>/g; +# $str .= sprintf("%-15s%-50s
    %s
    ", $cmd, $a[0], $a[1]); +# } +# +# return "$str
    "; + } }