Line editing.

The program can be started in line editing mode. In this mode, the
current line can be edited by inserting/deleting characters. Escape
values can be used for bytes.

Controls:
    printable   - adds character to the position of the cursor
    RIGHT, LEFT - moves cursor in the line
    UP, DOWN    - gets prevoiusly sent lines from the history
    BACKSPACE   - deletes character before the cursor
    ENTER       - sends line

Commands:
    :?          - list available commands
    :q          - quit
    :v          - show version
    ::          - send ':'

Escapes:
    \dNNN       - decimal NNN       (e.g: \d045      = 45)
    \xNN        - hexadecimal NN    (e.g: \xff       = 255)
    \bNNNNNNNN  - binary NNNNNNNN   (e.g: \b00000001 = 1)

Added option --line-edit, to start the program in line editing mode.
Added option --no-newline-in-line-edit to prevent sending newline
characters.
This commit is contained in:
g0mb4 2021-07-29 15:59:27 +02:00
parent 7fc8e278ed
commit aa9f6435db
10 changed files with 730 additions and 195 deletions

View file

@ -17,8 +17,14 @@ _tio()
-p --parity \
-o --output-delay \
-n --no-autoconnect \
-e --local-echo \
-t --timestamp \
-l --log \
-m --map \
-x --hex \
--newline-in-hex \
--line-edit \
--no-newline-in-line-edit \
-v --version \
-t --timestamp \
-h --help"
@ -70,6 +76,22 @@ _tio()
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
return 0
;;
-x | --hex)
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
return 0
;;
--newline-in-hex)
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
return 0
;;
--line-edit)
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
return 0
;;
--no-newline-in-line-edit)
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
return 0
;;
-v | --version)
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
return 0