Append a trailing slash to entries that contain other entries. Thanks
to Jonathan Rozes <jonathan@laika.com> for the idea, and Michael Granger <ged@faeriemud.org> for telling me about the hasSubordinates attribute (that he was already using to do exactly this in the Treequel-based ruby shell, heh!) FossilOrigin-Name: 0ba6d54560597cf729b319c54229a6331218cd31d18e7e0edddfa5f132480c3d
This commit is contained in:
parent
7885c220b5
commit
29f2cdb50c
1 changed files with 14 additions and 3 deletions
15
shelldap
15
shelldap
|
|
@ -1402,8 +1402,12 @@ sub run_list
|
|||
$long = $flags =~ /l/;
|
||||
}
|
||||
|
||||
my $s = $self->search({ scope => $recurse ? 'sub' : 'one',
|
||||
vals => $long, filter => $filter });
|
||||
my $s = $self->search({
|
||||
scope => $recurse ? 'sub' : 'one',
|
||||
vals => 1,
|
||||
filter => $filter,
|
||||
attrs => [ '*', 'hasSubordinates' ]
|
||||
});
|
||||
if ( $s->{'code'} ) {
|
||||
print "$s->{'message'}\n";
|
||||
return;
|
||||
|
|
@ -1429,6 +1433,13 @@ sub run_list
|
|||
my $dn;
|
||||
foreach my $e ( sort { $a->dn() cmp $b->dn() } @{ $s->{'entries'} } ) {
|
||||
$dn = $e->dn();
|
||||
|
||||
# if this entry is a container for other entries, append a
|
||||
# trailing slash.
|
||||
if ( $e->get_value('hasSubordinates') eq 'TRUE' ) {
|
||||
$dn .= '/';
|
||||
}
|
||||
|
||||
my $rdn = $dn;
|
||||
$rdn =~ s/,$base//i;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue