From 81e13d84743fecf6edefa333927f1c502b16b60e Mon Sep 17 00:00:00 2001 From: Oliver Tappe Date: Thu, 7 Aug 2008 21:38:54 +0000 Subject: * 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 --- config-db/slxconfig | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) (limited to 'config-db/slxconfig') 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 [] >> +=item B<< list-attributes [] >> -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 [] >> -- cgit v1.2.3-55-g7522