aboutsummaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2020-06-04 18:31:50 +0200
committerKim Alvefur <zash@zash.se>2020-06-04 18:31:50 +0200
commit6bcf492c34189308db20ff64e344f823e341aa77 (patch)
tree54b9761504fb278e67036922185e421664efe1f9 /util
parent24c071f9a17c2b5252ba2854b0f958669f822bd1 (diff)
downloadprosody-6bcf492c34189308db20ff64e344f823e341aa77.tar.gz
prosody-6bcf492c34189308db20ff64e344f823e341aa77.zip
util.human.io: Draw a separator between columns
Diffstat (limited to 'util')
-rw-r--r--util/human/io.lua5
1 files changed, 3 insertions, 2 deletions
diff --git a/util/human/io.lua b/util/human/io.lua
index 2cea4f6b..0f0c9155 100644
--- a/util/human/io.lua
+++ b/util/human/io.lua
@@ -97,9 +97,10 @@ end
local function new_table(col_specs, max_width)
max_width = max_width or tonumber(os.getenv("COLUMNS")) or 80;
+ local separator = " | ";
local widths = {};
- local total_width = max_width;
+ local total_width = max_width - #separator * (#col_specs-1);
local free_width = total_width;
-- Calculate width of fixed-size columns
for i = 1, #col_specs do
@@ -137,7 +138,7 @@ local function new_table(col_specs, max_width)
end
table.insert(output, v);
end
- return table.concat(output);
+ return table.concat(output, separator);
end;
end