summaryrefslogtreecommitdiffstats
path: root/config-db/slxconfig
diff options
context:
space:
mode:
authorOliver Tappe2008-08-07 23:38:54 +0200
committerOliver Tappe2008-08-07 23:38:54 +0200
commit81e13d84743fecf6edefa333927f1c502b16b60e (patch)
tree97d73d17588a0ff8aa626c14107f196b4ef97eb7 /config-db/slxconfig
parent* added explicit check against 64-bit/32-bit mismatch to (diff)
downloadcore-81e13d84743fecf6edefa333927f1c502b16b60e.tar.gz
core-81e13d84743fecf6edefa333927f1c502b16b60e.tar.xz
core-81e13d84743fecf6edefa333927f1c502b16b60e.zip
* fixed list-attributes command to support being given attribute names, too
(instead of just attribute scopes) * corrected help text for list-attributes git-svn-id: http://svn.openslx.org/svn/openslx/openslx/trunk@1988 95ad53e4-c205-0410-b2fa-d234c58c8868
Diffstat (limited to 'config-db/slxconfig')
-rwxr-xr-xconfig-db/slxconfig26
1 files changed, 19 insertions, 7 deletions
diff --git a/config-db/slxconfig b/config-db/slxconfig
index 3d9eba0a..66a77d15 100755
--- a/config-db/slxconfig
+++ b/config-db/slxconfig
@@ -102,9 +102,6 @@ elsif ($action =~ m[^cleanup-db]i) {
cleanupConfigDB(@ARGV);
}
elsif ($action =~ m[^list-a]) {
- print @ARGV
- ? _tr("List of known attributes for scope '%s':\n", $ARGV[0])
- : _tr("List of known attributes:\n");
listAttributes(@ARGV);
}
elsif ($action =~ m[^list-c]) {
@@ -389,9 +386,23 @@ sub dumpElements
sub listAttributes
{
- my $scope = shift;
+ my $attrSpec = shift;
- my $attrInfo = OpenSLX::AttributeRoster->getAttrInfo( { scope => $scope } );
+ my $listHeader = _tr("List of known attributes:\n");
+ my $attrInfo
+ = OpenSLX::AttributeRoster->getAttrInfo( { scope => $attrSpec } );
+ if ($attrInfo && keys %$attrInfo) {
+ $listHeader
+ = _tr("List of known attributes for scope '%s':\n", $attrSpec);
+ }
+ else {
+ $attrInfo =
+ OpenSLX::AttributeRoster->getAttrInfo( { name => $attrSpec } );
+ $listHeader = _tr("Details for attribute '%s':\n", $attrSpec);
+ $option{verbose} = 1;
+ }
+
+ print $listHeader;
dumpElements(
'attribute', undef,
map {
@@ -1507,9 +1518,10 @@ You should only invoke this if you are a developer and have removed one or
more plugins from the repository and would like to get rid of the left-overs
in your local DB.
-=item B<< list-attributes [<attr-scope>] >>
+=item B<< list-attributes [<attr-scope-or-attr-name>] >>
-lists all attributes or the one with the given name
+lists all attributes, the ones in the given scope or the one with the given
+name
=item B<< list-client [<client-name>] >>