2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-01-31 06:39:11 +00:00

version command added

git-svn-id: https://svn.fhem.de/fhem/trunk@3413 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2013-07-13 11:56:22 +00:00
parent bddfea6c6a
commit 2fd7e66074
4 changed files with 64 additions and 0 deletions

View File

@ -1,5 +1,6 @@
# Add changes at the top of the list. Keep it in ASCII
- SVN
- feature: fhem.pl: version command added
- feature: LightScene: add html overview of all configured scenes in
detail view. allow usage of overview in a weblink.
- feature: FLOORPLAN: enhanced detail-screen for floorplans in fhemweb,

View File

@ -61,6 +61,7 @@
<a href="#trigger">trigger</a> &nbsp;
<a href="#update">update</a> &nbsp;
<a href="#usb">usb</a> &nbsp;
<a href="#version">version</a> &nbsp;
<a href="#xmllist">xmllist</a> &nbsp;
</ul>
@ -961,6 +962,24 @@ A line ending with \ will be concatenated with the next one, so long lines
blocking fhem.<br>
</ul>
<a name="version"></a>
<h3>version</h3>
<ul>
<code>version [filter]</code>
<br><br>
List the version of fhem.pl and all loaded modules. The optional parameter
can be used to filter the ouput.
<br><br>
Example output:
<ul>
<code>
# $Id: fhem.pl 3405 2013-07-11 19:46:39Z rudolfkoenig $<br>
# $Id: 00_CUL.pm 3237 2013-06-01 17:15:59Z rudolfkoenig $<br>
# $Id: 10_CUL_HM.pm 3378 2013-07-02 16:57:27Z martinp876 $<br>
</code>
</ul>
</ul>
<a name="global"></a>
<h3>global</h3>

View File

@ -61,6 +61,7 @@
<a href="#trigger">trigger</a> &nbsp;
<a href="#update">update</a> &nbsp;
<a href="#usb">usb</a> &nbsp;
<a href="#version">version</a> &nbsp;
<a href="#xmllist">xmllist</a> &nbsp;
</ul>
@ -1003,6 +1004,25 @@ Zeilen erstreckende Befehle, indem man keine \ am Zeilenende eingeben muss.</p>
blockiert die Abarbeitung von FHHM nicht.<br>
</ul>
<a name="version"></a>
<h3>version</h3>
<ul>
<code>version [filter]</code>
<br><br>
Gibt die Versionsinformation von fhem.pl und aller geladenen Module aus. Mit der
optionalen Parameter kann man die Ausgabe filtern.
<br><br>
Beispiel der Ausgabe:
<ul>
<code>
# $Id: fhem.pl 3405 2013-07-11 19:46:39Z rudolfkoenig $<br>
# $Id: 00_CUL.pm 3237 2013-06-01 17:15:59Z rudolfkoenig $<br>
# $Id: 10_CUL_HM.pm 3378 2013-07-02 16:57:27Z martinp876 $<br>
</code>
</ul>
</ul>
<a name="global"></a>
<h3>global</h3>

View File

@ -270,6 +270,7 @@ $readingFnAttributes = "event-on-change-reading event-on-update-reading ".
"update" => {
Hlp => "[development|stable] [<file>|check|fhem],update Fhem" },
"updatefhem" => { ReplacedBy => "update" },
"version" => { Fn => "CommandVersion" },
);
###################################################
@ -2082,6 +2083,29 @@ CommandSleep($$)
return undef;
}
#####################################
sub
CommandVersion($$)
{
my ($cl, $param) = @_;
my @ret = ("# $cvsid");
foreach my $m (sort keys %modules) {
next if(!$modules{$m}{LOADED} || $modules{$m}{ORDER} < 0);
my $fn = "$attr{global}{modpath}/FHEM/".$modules{$m}{ORDER}."_$m.pm";
if(!open(FH, $fn)) {
push @ret, "$fn: $!";
} else {
push @ret, map { chomp; $_ } grep(/# \$Id:/, <FH>);
}
}
if($param) {
return join("\n", grep /$param/, @ret);
} else {
return join("\n", @ret);
}
}
sub
WakeUpFn($)
{