Add support for configurable timestamp format

Also changes default timestamp format from ISO8601 to classic 24-hour
format as this is assumed to be the format that most users would prefer.

And reintroduces strict but optional ISO8601 format.

This feature allows to easily add more timestamp formats in the future.
This commit is contained in:
Martin Lund 2022-02-19 02:12:24 +01:00
parent 47694904cf
commit d8a822a3fb
6 changed files with 94 additions and 27 deletions

View file

@ -57,9 +57,21 @@ option is provided, tio will exit if the device is not present or an established
Enable local echo.
.TP
.BR \-t ", " \-\-timestamp
.BR \-t ", " \-\-timestamp[=<format>]
Enable line timestamp.
Enable timestamp. Optionally you can specify any of the following timestamp formats:
.RS
.TP 16n
.IP "\fB24hour"
24-hour format ("hh:mm:ss.sss")
.IP "\fB24hour-start"
24-hour format relative to start time
.IP "\fBiso8601"
ISO8601 format ("YYYY-MM-DDThh:mm:ss.sss")
.P
Default format is
.B 24hour
.RE
.TP
.BR \-L ", " \-\-list\-devices
@ -75,7 +87,6 @@ Log to file.
.BR \-m ", " "\-\-map " \fI<flags>
Map (replace, translate) special characters on input or output. The following mapping flags are supported:
.RS
.TP 12n
.IP "\fBICRNL"