Matthew Wild <mwild1@gmail.com> [Fri, 07 Apr 2023 14:14:53 +0100] rev 13058
util.human.io: Add parse_duration() method to parse a duration string
Similar logic occurs throughout various modules in the codebase. We might even
want a module:get_option_duration()??
Kim Alvefur <zash@zash.se> [Fri, 07 Apr 2023 14:03:24 +0200] rev 13057
mod_admin_shell: Allow "*" as substitute for 'nil' for easier CLI usage
Since prosodyctl shell with additional arguments assumes the first two
are a section:command() and any following arguments are strings, passing
a bare 'nil' is not possible. In order to avoid delving into this rabbit
hole, instead produce a token that alone is not really a legal JID for
use as wildcard.
Kim Alvefur <zash@zash.se> [Fri, 07 Apr 2023 13:58:39 +0200] rev 13056
util.prosodyctl.shell: Fix sending terminal width with single argument
E.g. when you do 'prosodyctl shell "s2s:show()"', this is the case that
triggers, and it was missing the @width argument, causing confusion.
Kim Alvefur <zash@zash.se> [Fri, 07 Apr 2023 13:54:16 +0200] rev 13055
util.human.io: Coerce $COLUMNS to number
os.getenv() returns a string but term_width() should return a number
Kim Alvefur <zash@zash.se> [Fri, 07 Apr 2023 13:53:40 +0200] rev 13054
util.prosodyctl.shell: Coerce terminal width to string (for util.stanza)
Fixes invalid attribute value: expected string, got number
Matthew Wild <mwild1@gmail.com> [Fri, 07 Apr 2023 12:51:26 +0100] rev 13053
util.human.io: table: don't read $COLUMNS directly, just use term_width()
...which now reads $COLUMNS for us and does the right thing.
Matthew Wild <mwild1@gmail.com> [Fri, 07 Apr 2023 12:47:24 +0100] rev 13052
util.human.io: table: Return determined width as a second result
This allows callers to adjust other things based on the width of the rows
(such as header lines).
Kim Alvefur <zash@zash.se> [Fri, 07 Apr 2023 13:42:20 +0200] rev 13051
util.human.io: Prefer using the $COLUMNS environment variable if set (by readline)
Feels like it should be faster.
Kim Alvefur <zash@zash.se> [Fri, 07 Apr 2023 13:38:59 +0200] rev 13050
util.prosodyctl.shell: Use new term_width() for width
Kicks in if/when readline hasn't set $COLUMNS, e.g. when using the
`prosodyctl shell command like this` form.
Matthew Wild <mwild1@gmail.com> [Fri, 07 Apr 2023 12:35:39 +0100] rev 13049
util.human.io: table: use term_width() to discover terminal width