From 2fd7e6607497a6a940eb601653d74d6bbf8172dd Mon Sep 17 00:00:00 2001 From: rudolfkoenig <> Date: Sat, 13 Jul 2013 11:56:22 +0000 Subject: [PATCH] version command added git-svn-id: https://svn.fhem.de/fhem/trunk@3413 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/CHANGED | 1 + fhem/docs/commandref_frame.html | 19 +++++++++++++++++++ fhem/docs/commandref_frame_DE.html | 20 ++++++++++++++++++++ fhem/fhem.pl | 24 ++++++++++++++++++++++++ 4 files changed, 64 insertions(+) diff --git a/fhem/CHANGED b/fhem/CHANGED index 5a10d61cf..b64361d06 100644 --- a/fhem/CHANGED +++ b/fhem/CHANGED @@ -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, diff --git a/fhem/docs/commandref_frame.html b/fhem/docs/commandref_frame.html index 55f0cf32f..593ecebc4 100644 --- a/fhem/docs/commandref_frame.html +++ b/fhem/docs/commandref_frame.html @@ -61,6 +61,7 @@ trigger   update   usb   + version   xmllist   @@ -961,6 +962,24 @@ A line ending with \ will be concatenated with the next one, so long lines blocking fhem.
+ +

version

+

global

diff --git a/fhem/docs/commandref_frame_DE.html b/fhem/docs/commandref_frame_DE.html index 92b72214f..6e066b19c 100644 --- a/fhem/docs/commandref_frame_DE.html +++ b/fhem/docs/commandref_frame_DE.html @@ -61,6 +61,7 @@ trigger   update   usb   + version   xmllist   @@ -1003,6 +1004,25 @@ Zeilen erstreckende Befehle, indem man keine \ am Zeilenende eingeben muss.

blockiert die Abarbeitung von FHHM nicht.
+ +

version

+ +

global

diff --git a/fhem/fhem.pl b/fhem/fhem.pl index 799f8a7a2..085dd7769 100755 --- a/fhem/fhem.pl +++ b/fhem/fhem.pl @@ -270,6 +270,7 @@ $readingFnAttributes = "event-on-change-reading event-on-update-reading ". "update" => { Hlp => "[development|stable] [|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:/, ); + } + } + if($param) { + return join("\n", grep /$param/, @ret); + } else { + return join("\n", @ret); + } +} + sub WakeUpFn($) {