sort by filesystem/mount_point
Robert 'phaylon' Sedlacek [Fri, 11 May 2012 21:57:09 +0000 (21:57 +0000)]
lib/System/Introspector/DiskUsage.pm

index 467f976..b2d1d9e 100644 (file)
@@ -24,7 +24,12 @@ sub gather {
             )} = split m{\s+}, $line;
             push @rows, \%row;
         }
-        return { disk_usage => \@rows };
+        no warnings 'uninitialized';
+        return { disk_usage => [ sort {
+            ($a->{filesystem} cmp $b->{filesystem})
+            ||
+            ($a->{mount_point} cmp $b->{mount_point})
+        } @rows ] };
     };
 }