Add command to show version

The key sequence ctrl-t v will now show the version of tio.
This commit is contained in:
Martin Lund 2018-11-27 23:56:29 +01:00
parent 42eb14dd77
commit 39a8f63640
3 changed files with 8 additions and 0 deletions

View file

@ -117,6 +117,8 @@ Quit
Show TX/RX statistics Show TX/RX statistics
.IP "\fBctrl-t t" .IP "\fBctrl-t t"
Send ctrl-t key code Send ctrl-t key code
.IP "\fBctrl-t v"
Show version
.SH "EXAMPLES" .SH "EXAMPLES"
.TP .TP

View file

@ -33,6 +33,7 @@
#define KEY_T 0x74 #define KEY_T 0x74
#define KEY_SHIFT_T 0x54 #define KEY_SHIFT_T 0x54
#define KEY_CTRL_T 0x14 #define KEY_CTRL_T 0x14
#define KEY_V 0x76
#define NORMAL 0 #define NORMAL 0
#define HEX 1 #define HEX 1

View file

@ -109,6 +109,7 @@ void handle_command_sequence(char input_char, char previous_char, char *output_c
tio_printf(" ctrl-t s Show statistics"); tio_printf(" ctrl-t s Show statistics");
tio_printf(" ctrl-t t Send ctrl-t key code"); tio_printf(" ctrl-t t Send ctrl-t key code");
tio_printf(" ctrl-t T Toggle timestamps"); tio_printf(" ctrl-t T Toggle timestamps");
tio_printf(" ctrl-t v Show version");
break; break;
case KEY_B: case KEY_B:
@ -178,6 +179,10 @@ void handle_command_sequence(char input_char, char previous_char, char *output_c
option.timestamp = !option.timestamp; option.timestamp = !option.timestamp;
break; break;
case KEY_V:
tio_printf("tio v%s", VERSION);
break;
default: default:
/* Ignore unknown ctrl-t escaped keys */ /* Ignore unknown ctrl-t escaped keys */
break; break;