X-Git-Url: https://git.camperquake.de/gitweb.cgi?a=blobdiff_plain;f=libvideosite.pm;h=e4e1878fb6ec9013cafb4f06492e7aeba5dc483f;hb=f1950abbacdeb7e72c1303fc02d58d01b622e833;hp=3554201c814b7b05694bb2916960a326b4e94c2b;hpb=ae02b5f92b84fc5e6cba1986dcce7d2a7a7f5aa1;p=videosite.git diff --git a/libvideosite.pm b/libvideosite.pm index 3554201..e4e1878 100644 --- a/libvideosite.pm +++ b/libvideosite.pm @@ -34,7 +34,7 @@ my $getter; my %builtin_config = (); my $builtin_config_path; my $builtin_config_default; -my $config_cache = 0; +my $config_cache = 1; my %config_cache = (); our $error; @@ -931,14 +931,27 @@ sub _cmd_nodebug { } # -# Display the content of the config cache +# Display or clear the content of the config cache # sub _cmd_cache { my $event = shift; + my $subcmd = shift; + + $subcmd = 'list' unless defined($subcmd); + $subcmd = lc($subcmd); - _io("Content of config cache:"); - foreach (sort(keys(%config_cache))) { - _io("%s => %s", $_, Dumper($config_cache{$_})); + if ($subcmd eq 'list') { + _io("Content of config cache:"); + foreach (sort(keys(%config_cache))) { + if (exists($config_cache{$_}->{value})) { + _io(" %s => %s", $_, $config_cache{$_}->{value}); + } else { + _io(" %s present", $_); + } + } + } elsif ($subcmd eq 'clear') { + _debug("Clearing config cache"); + %config_cache = (); } }