[pve-devel] [PATCH storage] pvesm status: add column names at top of output

Thomas Lamprecht t.lamprecht at proxmox.com
Thu May 18 11:16:14 CEST 2017


allow easier understanding of what each row means.

I replaced 'activated' with 'ready' for shortness sake

Signed-off-by: Thomas Lamprecht <t.lamprecht at proxmox.com>
---

 PVE/CLI/pvesm.pm | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/PVE/CLI/pvesm.pm b/PVE/CLI/pvesm.pm
index ba2c91b..8dd7cfa 100755
--- a/PVE/CLI/pvesm.pm
+++ b/PVE/CLI/pvesm.pm
@@ -134,13 +134,16 @@ my $print_status = sub {
     }
     $maxlen+=1;
 
+    printf "%-${maxlen}s %10s %6s %13s %15s %15s %5s\n", 'name', 'type',
+	'ready', 'total', 'available', 'used', '%';
+
     foreach my $res (sort { $a->{storage} cmp $b->{storage} } @$res) {
 	my $storeid = $res->{storage};
 
 	my $sum = $res->{used} + $res->{avail};
 	my $per = $sum ? (0.5 + ($res->{used}*100)/$sum) : 100;
 
-	printf "%-${maxlen}s %5s %1d %15d %15d %15d %.2f%%\n", $storeid,
+	printf "%-${maxlen}s %10s %4d %15d %15d %15d %.2f%%\n", $storeid,
 	$res->{type}, $res->{active},
 	$res->{total}/1024, $res->{used}/1024, $res->{avail}/1024, $per;
     }
-- 
2.11.0





More information about the pve-devel mailing list