summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStuart Quin <stuart.quin@gmail.com>2015-10-19 18:45:43 +0100
committerStuart Quin <stuart.quin@gmail.com>2015-10-19 18:45:43 +0100
commit6bb6e90f83929d26b3412e5859399dcfb72d4a62 (patch)
treedf0b6d0247feab4eb1f8405678816fc275c72031
parentaffc694ff3665d7615e0553c0038b733baaacd82 (diff)
parenteb209e260265f4747378214ba1aa9d6579e3639e (diff)
Merge pull request #391 from dbcli/amjith/x-auto-headers
Check for headers in \x auto mode.
-rwxr-xr-xpgcli/main.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/pgcli/main.py b/pgcli/main.py
index 1ee56836..6e1ef960 100755
--- a/pgcli/main.py
+++ b/pgcli/main.py
@@ -533,7 +533,9 @@ def format_output(title, cur, headers, status, table_format, expanded=False, max
else:
tabulated, rows = tabulate(cur, headers, tablefmt=table_format,
missingval='<null>')
- if max_width and content_exceeds_width(rows[0], max_width):
+ if (max_width and
+ content_exceeds_width(rows[0], max_width) and
+ headers):
output.append(expanded_table(rows, headers))
else:
output.append(tabulated)