diff options
author | Matthew Wild <mwild1@gmail.com> | 2020-06-04 17:24:30 +0100 |
---|---|---|
committer | Matthew Wild <mwild1@gmail.com> | 2020-06-04 17:24:30 +0100 |
commit | 3a849a580d3fabdfb22c7da60710d3ec8ec75e42 (patch) | |
tree | 5afed8b7f9173d88784a9e7dfb1333faa96c5e39 /util/human | |
parent | 15b298c191115c9acdba05d9bd2cf8d3d64f0468 (diff) | |
download | prosody-3a849a580d3fabdfb22c7da60710d3ec8ec75e42.tar.gz prosody-3a849a580d3fabdfb22c7da60710d3ec8ec75e42.zip |
util.human.io: Remove padding option and use $COLUMNS as default width
Diffstat (limited to 'util/human')
-rw-r--r-- | util/human/io.lua | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/util/human/io.lua b/util/human/io.lua index 9e700e89..2cea4f6b 100644 --- a/util/human/io.lua +++ b/util/human/io.lua @@ -95,12 +95,11 @@ local function padleft(s, width) 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 |