summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/llnl/util/tty/colify.py17
1 files changed, 13 insertions, 4 deletions
diff --git a/lib/spack/llnl/util/tty/colify.py b/lib/spack/llnl/util/tty/colify.py
index d5e0aa8def..6a4fc3b0e5 100644
--- a/lib/spack/llnl/util/tty/colify.py
+++ b/lib/spack/llnl/util/tty/colify.py
@@ -199,10 +199,16 @@ def colify(elts, **options):
def colify_table(table, **options):
"""Version of ``colify()`` for data expressed in rows, (list of lists).
- Same as regular colify but takes a list of lists, where each
- sub-list must be the same length, and each is interpreted as a
- row in a table. Regular colify displays a sequential list of
- values in columns.
+ Same as regular colify but:
+
+ 1. This takes a list of lists, where each sub-list must be the
+ same length, and each is interpreted as a row in a table.
+ Regular colify displays a sequential list of values in columns.
+
+ 2. Regular colify will always print with 1 column when the output
+ is not a tty. This will always print with same dimensions of
+ the table argument.
+
"""
if table is None:
raise TypeError("Can't call colify_table on NoneType")
@@ -220,6 +226,9 @@ def colify_table(table, **options):
raise ValueError("Cannot override columsn in colify_table.")
options['cols'] = columns
+ # don't reduce to 1 column for non-tty
+ options['tty'] = True
+
colify(transpose(), **options)