]> git.proxmox.com Git - pve-guest-common.git/commitdiff
print snapshot tree: reduce indentation delta per level
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Tue, 1 Mar 2022 12:06:21 +0000 (13:06 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Tue, 1 Mar 2022 12:06:35 +0000 (13:06 +0100)
previous:

> `-> foo                         2021-05-28 12:59:36 no-description
>   `-> bar                       2021-06-18 12:44:48 no-description
>     `-> current                                     You are here!

now:

> `-> foo                         2021-05-28 12:59:36 no-description
>  `-> bar                        2021-06-18 12:44:48 no-description
>   `-> current                                       You are here!

So requires less space, allowing deeper snapshot trees to still be
displayed nicely, and looks even better while doing that - the latter
may be subjective though.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
src/PVE/GuestHelpers.pm

index 0c8ed663b4d8919ed98138344b1127045e8e17c8..0fe3fd69344a3fae429db1c35818eb1c53e789e8 100644 (file)
@@ -161,7 +161,7 @@ sub print_snapshot_tree {
        printf("%s %-${len}s %-23s %s\n", $prefix, $root, $timestring, $description);
 
        if ($e->{children}) {
-           $prefix = "  $prefix";
+           $prefix = " $prefix";
            foreach my $child (sort $snaptimesort @{$e->{children}}) {
                $snapshottree_weak->($prefix, $child, $snapshots);
            }