Do not sort flaglist twice
With this change, 'inspect'ing an element prints its attributes
in a defined order: (requiredness, multivaluedness)
Previously, the order was alphabetical and varying.
--- a/shelldap Mon Apr 29 00:10:31 2019 +0200
+++ b/shelldap Mon Apr 29 00:16:14 2019 +0200
@@ -2327,6 +2327,9 @@
print "\nAttributes:\n";
foreach my $attr ( sort (@{$must_attr}, @{$may_attr}) ) {
my @flaglist;
+
+ push ( @flaglist, $must{$attr} ? 'required' : 'optional' );
+
if ( $self->{'schema'}->attribute( $attr )->{'single-value'} ) {
push ( @flaglist, 'single-value' );
}
@@ -2334,10 +2337,8 @@
push ( @flaglist, 'multivalue' );
}
- push ( @flaglist, $must{$attr} ? 'required' : 'optional' );
-
my $flags = '';
- $flags = (' (' . join( ', ', sort @flaglist ) . ')') if scalar @flaglist > 0;
+ $flags = (' (' . join( ', ', @flaglist ) . ')') if scalar @flaglist > 0;
printf( " %s%s\n", $attr, $flags );
}