Better tabulation for spack checksum (#2673)

This commit is contained in:
Adam J. Stewart 2016-12-25 22:25:53 -05:00 committed by Todd Gamblin
parent 91bfebbed8
commit f34c5367d5

View file

@ -93,9 +93,13 @@ def checksum(parser, args):
sorted_versions = sorted(versions, reverse=True) 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), tty.msg("Found %s versions of %s" % (len(versions), pkg.name),
*spack.cmd.elide_list( *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 print
archives_to_fetch = tty.get_number( archives_to_fetch = tty.get_number(
"How many would you like to checksum?", default=5, abort='q') "How many would you like to checksum?", default=5, abort='q')