From bf6ab60b2ca3c65a4a2acfcbab9b3a8952fcf604 Mon Sep 17 00:00:00 2001 From: Harald Hope Date: Mon, 24 Sep 2018 19:07:33 -0700 Subject: [PATCH] small fix, forgot to switch between numeric and alpha sorts for partitions --- inxi | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/inxi b/inxi index fd5d9f8..ede976f 100755 --- a/inxi +++ b/inxi @@ -11015,7 +11015,13 @@ sub create_output { my $num = 0; my $j = 0; my (@data,@data2,%part,@rows,$dev,$dev_type,$fs,$percent,$raw_size,$size,$used); - @partitions = sort { $a->{$show{'partition-sort'}} cmp $b->{$show{'partition-sort'}} } @partitions; + # alpha sort for non numerics + if ($show{'partition-sort'} !~ /^(percent-used|size|used)$/){ + @partitions = sort { $a->{$show{'partition-sort'}} cmp $b->{$show{'partition-sort'}} } @partitions; + } + else { + @partitions = sort { $a->{$show{'partition-sort'}} <=> $b->{$show{'partition-sort'}} } @partitions; + } foreach my $ref (@partitions){ my %row = %$ref; $num = 1;