Hide empty columns in table package list display
commit33bb7dbd356bd1164a1bd6418c0615808fae13f7
authorDan McGee <dan@archlinux.org>
Fri, 21 Oct 2011 16:41:15 +0000 (21 11:41 -0500)
committerDan McGee <dan@archlinux.org>
Sat, 22 Oct 2011 00:29:31 +0000 (21 19:29 -0500)
treeb85e4f8086c79e61381b2523312e86ebaa016e6e
parent32327dc8c9679232ae55935615088c0696f49e86
Hide empty columns in table package list display

On -R operations, the "New Version" column is always empty, taking up
space and not really showing the user anything valuable. The same is
true on -S or -U operations for the "Old Version" column when packages
are only being installed and not upgraded.

Remove this column so we get a few screen columns back, especially now
that we show repo/packagename style output. This also makes some
adjustment to the padding logic. We no longer include padding in column
widths but it is included in the total table width. We also ensure the
last displayed column is always right aligned, even if this is not the
actual rightmost column.

Example output, before:
    $ sudo pacman -R eclipse
    checking dependencies...

    Targets (1):

    Name     Old Version  New Version   Net Change

    eclipse  3.7-1                     -194.02 MiB

    Total Removed Size:     194.02 MiB

And after:
    $ sudo pacman -R eclipse
    checking dependencies...

    Targets (1):

    Name     Old Version   Net Change

    eclipse  3.7-1        -194.02 MiB

    Total Removed Size:     194.02 MiB

Signed-off-by: Dan McGee <dan@archlinux.org>
src/pacman/util.c