Make all the Prompts in stat/* like output appear in alphebetical order
authorminima <minima>
Fri, 7 Sep 2001 19:45:22 +0000 (19:45 +0000)
committerminima <minima>
Fri, 7 Sep 2001 19:45:22 +0000 (19:45 +0000)
Changes
perl/DXUtil.pm

diff --git a/Changes b/Changes
index ea3cff074749058dc523544ab292f523b6e248bb..b1fd8ff07a1bfd6f3e978d51894ae5b375f606bf 100644 (file)
--- a/Changes
+++ b/Changes
@@ -1,6 +1,7 @@
 06Sep01=======================================================================
 1. prevent nodes appearing as users from incoming PC16s
 2. Change ping averaging to be like TCP and become a smoothed RTT.
+3. Make all the Prompts in stat/* like output appear in alphebetical order
 04Sep01=======================================================================
 1. add delete/user command
 03Sep01=======================================================================
index 10b3538767822ef46735fb4cc2a8b267e7a8c024..2c814ea33d834cbe5001eede20eecc0755059695 100644 (file)
@@ -183,6 +183,14 @@ sub parraypairs
        return $out;
 }
 
+sub _sort_fields
+{
+       my $ref = shift;
+       my @a = split /,/, $ref->field_prompt(shift); 
+       my @b = split /,/, $ref->field_prompt(shift); 
+       return lc $a[1] cmp lc $b[1];
+}
+
 # print all the fields for a record according to privilege
 #
 # The prompt record is of the format '<priv>,<prompt>[,<action>'
@@ -198,7 +206,7 @@ sub print_all_fields
        my $width = $self->width - 1;
        $width ||= 80;
 
-       foreach $field (sort {$ref->field_prompt($a) cmp $ref->field_prompt($b)} @fields) {
+       foreach $field (sort {_sort_fields($ref, $a, $b)} @fields) {
                if (defined $ref->{$field}) {
                        my ($priv, $ans) = promptf($ref->field_prompt($field), $ref->{$field});
                        my @tmp;