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. FossilOrigin-Name: bb3518297cc3ffdd6a8a1db79e681431f56f6d395f5300e6f99d0f444fc5fd04
This commit is contained in:
parent
7c6a055f0c
commit
69dbc50d3c
1 changed files with 4 additions and 3 deletions
7
shelldap
7
shelldap
|
|
@ -2327,6 +2327,9 @@ sub run_inspect
|
||||||
print "\nAttributes:\n";
|
print "\nAttributes:\n";
|
||||||
foreach my $attr ( sort (@{$must_attr}, @{$may_attr}) ) {
|
foreach my $attr ( sort (@{$must_attr}, @{$may_attr}) ) {
|
||||||
my @flaglist;
|
my @flaglist;
|
||||||
|
|
||||||
|
push ( @flaglist, $must{$attr} ? 'required' : 'optional' );
|
||||||
|
|
||||||
if ( $self->{'schema'}->attribute( $attr )->{'single-value'} ) {
|
if ( $self->{'schema'}->attribute( $attr )->{'single-value'} ) {
|
||||||
push ( @flaglist, 'single-value' );
|
push ( @flaglist, 'single-value' );
|
||||||
}
|
}
|
||||||
|
|
@ -2334,10 +2337,8 @@ sub run_inspect
|
||||||
push ( @flaglist, 'multivalue' );
|
push ( @flaglist, 'multivalue' );
|
||||||
}
|
}
|
||||||
|
|
||||||
push ( @flaglist, $must{$attr} ? 'required' : 'optional' );
|
|
||||||
|
|
||||||
my $flags = '';
|
my $flags = '';
|
||||||
$flags = (' (' . join( ', ', sort @flaglist ) . ')') if scalar @flaglist > 0;
|
$flags = (' (' . join( ', ', @flaglist ) . ')') if scalar @flaglist > 0;
|
||||||
|
|
||||||
printf( " %s%s\n", $attr, $flags );
|
printf( " %s%s\n", $attr, $flags );
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue