summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAdam J. Stewart <ajstewart426@gmail.com>2016-12-25 22:25:53 -0500
committerTodd Gamblin <tgamblin@llnl.gov>2016-12-25 19:25:53 -0800
commitf34c5367d5b125c62adb3ddc2270b5d4a47c6e11 (patch)
tree32d74d88ad5c60fedebfe8dab72a2191006fcfac /lib
parent91bfebbed8673b95c425a174a1fa16d9e8fa0fde (diff)
downloadspack-f34c5367d5b125c62adb3ddc2270b5d4a47c6e11.tar.gz
spack-f34c5367d5b125c62adb3ddc2270b5d4a47c6e11.tar.bz2
spack-f34c5367d5b125c62adb3ddc2270b5d4a47c6e11.tar.xz
spack-f34c5367d5b125c62adb3ddc2270b5d4a47c6e11.zip
Better tabulation for spack checksum (#2673)
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/spack/cmd/checksum.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/spack/spack/cmd/checksum.py b/lib/spack/spack/cmd/checksum.py
index 2e24d0527e..b45cfcbd39 100644
--- a/lib/spack/spack/cmd/checksum.py
+++ b/lib/spack/spack/cmd/checksum.py
@@ -93,9 +93,13 @@ def checksum(parser, args):
sorted_versions = sorted(versions, reverse=True)
+ # Find length of longest string in the list for padding
+ maxlen = max(len(str(v)) for v in versions)
+
tty.msg("Found %s versions of %s" % (len(versions), pkg.name),
*spack.cmd.elide_list(
- ["%-10s%s" % (v, versions[v]) for v in sorted_versions]))
+ ["{0:{1}} {2}".format(v, maxlen, versions[v])
+ for v in sorted_versions]))
print
archives_to_fetch = tty.get_number(
"How many would you like to checksum?", default=5, abort='q')