]> git.proxmox.com Git - pve-storage.git/commitdiff
Add cifsscan to CLI
authorWolfgang Link <w.link@proxmox.com>
Fri, 16 Mar 2018 09:22:58 +0000 (10:22 +0100)
committerDietmar Maurer <dietmar@proxmox.com>
Fri, 16 Mar 2018 11:07:39 +0000 (12:07 +0100)
PVE/CLI/pvesm.pm

index 9455595b442182b832d37f354901a637d868c817..e6c37eac0caef8bc66b222a097c5272604a42ff7 100755 (executable)
@@ -331,6 +331,19 @@ our $cmddef = {
                         printf "%-${maxlen}s %s\n", $rec->{path}, $rec->{options};
                     }
                 }],
+    cifsscan => [ "PVE::API2::Storage::Scan", 'cifsscan', ['server'],
+                { node => $nodename }, sub  {
+                    my $res = shift;
+
+                    my $maxlen = 0;
+                    foreach my $rec (@$res) {
+                        my $len = length ($rec->{share});
+                        $maxlen = $len if $len > $maxlen;
+                    }
+                    foreach my $rec (@$res) {
+                        printf "%-${maxlen}s %s\n", $rec->{share}, $rec->{description};
+                    }
+                }],
     glusterfsscan => [ "PVE::API2::Storage::Scan", 'glusterfsscan', ['server'],
                 { node => $nodename }, sub  {
                     my $res = shift;