# HG changeset patch # User Davor Ocelic # Date 1556489774 -7200 # Node ID 3e31beb6c84556378bb18d01046934f13cf50941 # Parent 94d941f13a5ab5919d940108b950c6c3b811219e 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. diff -r 94d941f13a5a -r 3e31beb6c845 shelldap --- 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 ); }