util/human/io.lua
changeset 10900 c7a0eab27165
parent 10898 d15a4284fdf8
child 10908 d009a79f723a
--- a/util/human/io.lua	Thu Jun 04 10:39:12 2020 +0100
+++ b/util/human/io.lua	Thu Jun 04 10:39:55 2020 +0100
@@ -121,13 +121,14 @@
 	end
 
 	return function (row)
+		local titles;
 		if not row then
-			row = array.pluck(col_specs, "title");
+			titles, row = true, array.pluck(col_specs, "title", "");
 		end
 		local output = {};
 		for i, column in ipairs(col_specs) do
 			local width = widths[i];
-			local v = tostring(row[column.key or i] or ""):sub(1, width);
+			local v = tostring(row[not titles and column.key or i] or ""):sub(1, width);
 			if #v < width then
 				if column.align == "right" then
 					v = padleft(v, width-1).." ";