Merge conflicts
[videosite.git] / libvideosite.pm
index 3554201..34191b8 100644 (file)
@@ -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 = ();
     }
 }