From: Peter Krempa Date: Tue, 12 Nov 2013 16:22:36 +0000 (+0100) Subject: virsh-pool: Unify spacing of listing function X-Git-Tag: v1.2.0-rc1~83 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=96f4b5eb8c39ae57608118e0bfc04e77e1516956;p=thirdparty%2Flibvirt.git virsh-pool: Unify spacing of listing function Change the alignment to match the domain listing function. Before: $ virsh pool-list Name State Autostart ----------------------------------------- boot-scratch active no default active no glusterpool active no $ virsh pool-list --details Name State Autostart Persistent Capacity Allocation Available ------------------------------------------------------------------------------- boot-scratch running no yes 117.99 GiB 101.40 GiB 16.60 GiB default running no yes 117.99 GiB 101.40 GiB 16.60 GiB glusterpool running no yes 29.40 GiB 44.23 MiB 29.36 GiB After: $ virsh pool-list Name State Autostart ------------------------------------------- boot-scratch active no default active no glusterpool active no $ virsh pool-list --details Name State Autostart Persistent Capacity Allocation Available --------------------------------------------------------------------------------- boot-scratch running no yes 117.99 GiB 101.40 GiB 16.60 GiB default running no yes 117.99 GiB 101.40 GiB 16.60 GiB glusterpool running no yes 29.40 GiB 44.23 MiB 29.36 GiB --- diff --git a/tools/virsh-pool.c b/tools/virsh-pool.c index c771226d57..18fe242a3f 100644 --- a/tools/virsh-pool.c +++ b/tools/virsh-pool.c @@ -1191,14 +1191,14 @@ cmdPoolList(vshControl *ctl, const vshCmd *cmd ATTRIBUTE_UNUSED) /* Output basic info then return if --details option not selected */ if (!details) { /* Output old style header */ - vshPrintExtra(ctl, "%-20s %-10s %-10s\n", _("Name"), _("State"), + vshPrintExtra(ctl, " %-20s %-10s %-10s\n", _("Name"), _("State"), _("Autostart")); - vshPrintExtra(ctl, "-----------------------------------------\n"); + vshPrintExtra(ctl, "-------------------------------------------\n"); /* Output old style pool info */ for (i = 0; i < list->npools; i++) { const char *name = virStoragePoolGetName(list->pools[i]); - vshPrint(ctl, "%-20s %-10s %-10s\n", + vshPrint(ctl, " %-20s %-10s %-10s\n", name, poolInfoTexts[i].state, poolInfoTexts[i].autostart); @@ -1266,7 +1266,7 @@ cmdPoolList(vshControl *ctl, const vshCmd *cmd ATTRIBUTE_UNUSED) * the longest string. */ ret = virAsprintf(&outputStr, - "%%-%lus %%-%lus %%-%lus %%-%lus %%%lus %%%lus %%%lus\n", + " %%-%lus %%-%lus %%-%lus %%-%lus %%%lus %%%lus %%%lus\n", (unsigned long) nameStrLength, (unsigned long) stateStrLength, (unsigned long) autostartStrLength, @@ -1285,7 +1285,7 @@ cmdPoolList(vshControl *ctl, const vshCmd *cmd ATTRIBUTE_UNUSED) for (i = nameStrLength + stateStrLength + autostartStrLength + persistStrLength + capStrLength + allocStrLength + availStrLength - + 12; i > 0; i--) + + 14; i > 0; i--) vshPrintExtra(ctl, "-"); vshPrintExtra(ctl, "\n");