diff options
author | Todd Gamblin <tgamblin@llnl.gov> | 2015-10-17 17:34:39 -0700 |
---|---|---|
committer | Todd Gamblin <tgamblin@llnl.gov> | 2015-10-17 17:34:39 -0700 |
commit | 7598612b86c35c062c2b7f4ed2bcee1729e11a03 (patch) | |
tree | ac6727014df740571064a6ffea18e877fa18ca99 | |
parent | 44ba16a391d75f97bab9ebf0a8f1b609b18aba1d (diff) | |
download | spack-7598612b86c35c062c2b7f4ed2bcee1729e11a03.tar.gz spack-7598612b86c35c062c2b7f4ed2bcee1729e11a03.tar.bz2 spack-7598612b86c35c062c2b7f4ed2bcee1729e11a03.tar.xz spack-7598612b86c35c062c2b7f4ed2bcee1729e11a03.zip |
Better info variant output.
-rw-r--r-- | lib/spack/spack/cmd/info.py | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/lib/spack/spack/cmd/info.py b/lib/spack/spack/cmd/info.py index c6209523f0..085e4db44d 100644 --- a/lib/spack/spack/cmd/info.py +++ b/lib/spack/spack/cmd/info.py @@ -65,11 +65,21 @@ def print_text_info(pkg): print "None" else: pad = padder(pkg.variants, 4) + + maxv = max(len(v) for v in sorted(pkg.variants)) + fmt = "%%-%ss%%-10s%%s" % (maxv + 4) + + print " " + fmt % ('Name', 'Default', 'Description') + print for name in sorted(pkg.variants): v = pkg.variants[name] - print " %s%s" % ( - pad(('+' if v.default else '-') + name + ':'), - "\n".join(textwrap.wrap(v.description))) + default = 'on' if v.default else 'off' + + lines = textwrap.wrap(v.description) + lines[1:] = [" " + (" " * maxv) + l for l in lines[1:]] + desc = "\n".join(lines) + + print " " + fmt % (name, default, desc) print print "Dependencies:" |