From 2177bb0e95a5ec8797f5a0d47bd2070666a92653 Mon Sep 17 00:00:00 2001 From: minima Date: Fri, 7 Sep 2001 19:45:22 +0000 Subject: [PATCH] Make all the Prompts in stat/* like output appear in alphebetical order --- Changes | 1 + perl/DXUtil.pm | 10 +++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/Changes b/Changes index ea3cff07..b1fd8ff0 100644 --- 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======================================================================= diff --git a/perl/DXUtil.pm b/perl/DXUtil.pm index 10b35387..2c814ea3 100644 --- a/perl/DXUtil.pm +++ b/perl/DXUtil.pm @@ -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 ',[,' @@ -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; -- 2.34.1