Software /
code /
prosody
Changeset
10904:d009a79f723a
util.human.io: Remove padding option and use $COLUMNS as default width
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Thu, 04 Jun 2020 17:24:30 +0100 |
parents | 10903:c5f26f9adb31 |
children | 10905:709255e332d8 |
files | util/human/io.lua |
diffstat | 1 files changed, 3 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/util/human/io.lua Thu Jun 04 16:56:28 2020 +0200 +++ b/util/human/io.lua Thu Jun 04 17:24:30 2020 +0100 @@ -95,12 +95,11 @@ return string.rep(" ", width-#s)..s; end -local function new_table(col_specs, max_width, padding) - max_width = max_width or 80; - padding = padding or 4; +local function new_table(col_specs, max_width) + max_width = max_width or tonumber(os.getenv("COLUMNS")) or 80; local widths = {}; - local total_width = max_width - padding; + local total_width = max_width; local free_width = total_width; -- Calculate width of fixed-size columns for i = 1, #col_specs do