summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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')