'name' => 'direct',
'_immutable' => '1',
'schemas' => {},
- }
+ },
+ 'environment' => {
+ 'name' => 'environment',
+ '_immutable' => '1',
+ 'schemas' => {},
+ },
},
'config-version' => '2',
};
'set' => sub {
_cmd_set(@_);
},
-
+
'show' => sub {
_cmd_show(@_);
},
_cmd_nodebug(@_);
},
- 'cache' => sub {
- _cmd_cache(@_);
+ 'service' => sub {
+ _cmd_service(@_);
},
};
}
_debug("Loaded %d plugins", $#g+1);
-
+
return @g;
}
_config_set($path, join(',', @c));
}
-#
+#
# Remove an item from the list
#
sub _config_list_del {
}
#
+# Handle generic service commands
+#
+sub _cmd_service {
+ my $event = shift;
+ my $subcmd = shift || '';
+
+ $subcmd = lc($subcmd);
+
+ if ($subcmd eq 'cache') {
+ _cmd_service_cache($event, @_);
+ }
+}
+
+
+#
# Display or clear the content of the config cache
#
-sub _cmd_cache {
+sub _cmd_service_cache {
my $event = shift;
my $subcmd = shift;
_io("Content of config cache:");
foreach (sort(keys(%config_cache))) {
if (exists($config_cache{$_}->{value})) {
- _io("%s => %s", $_, $config_cache{$_}->{value});
+ _io(" %s => %s", $_, $config_cache{$_}->{value});
} else {
- _io("%s present", $_);
+ _io(" %s present", $_);
}
}
} elsif ($subcmd eq 'clear') {
- _debug("Clearing config cache");
%config_cache = ();
+ _io("Cache cleared");
}
}