Add independent input and output mode

Replaces -x, --hexadecimal option with --intput-mode and --output-mode
so it is possible to select hex or normal mode for both input and output
independently.

To obtain same behaviour as -x, --hexadecimal use the following
configuration:

input-mode = hex
output-mode = hex
This commit is contained in:
Martin Lund 2024-04-10 14:39:42 +02:00
parent fd6a246908
commit 2fff4d36d0
9 changed files with 254 additions and 78 deletions

View file

@ -31,7 +31,8 @@ _tio()
-L --list-devices \
-c --color \
-S --socket \
-x --hexadecimal \
--input-mode \
--output-mode \
-r --response-wait \
--response-timeout \
--rs-485 \
@ -131,8 +132,12 @@ _tio()
COMPREPLY=( $(compgen -W "unix: inet: inet6:" -- ${cur}) )
return 0
;;
-x | --hexadecimal)
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
--input-mode)
COMPREPLY=( $(compgen -W "normal hex" -- ${cur}) )
return 0
;;
--output-mode)
COMPREPLY=( $(compgen -W "normal hex" -- ${cur}) )
return 0
;;
-r | --response-wait)