Add '-c, --color' option

Allow user to select which ANSI color code to use to colorize the tio
text. To successfully set the color the color code must be in the range
0..255.

If color code is negative tio will print all available ANSI colors.

The default color is changed to bold white to make tio defaults usable
for most users, including color blind users.
This commit is contained in:
Martin Lund 2022-02-14 09:08:54 +01:00
parent 32e853e46e
commit 274cb63197
7 changed files with 55 additions and 16 deletions

View file

@ -22,6 +22,7 @@ _tio()
-v --version \
-t --timestamp \
-L --list-devices \
-c --color \
-h --help"
# Complete the arguments to the options.
@ -75,6 +76,10 @@ _tio()
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
return 0
;;
-c | --color)
COMPREPLY=( $(compgen -W "$(seq 0 255)" -- ${cur}) )
return 0
;;
-v | --version)
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
return 0