mirror of
https://github.com/tio/tio.git
synced 2026-05-01 14:57:59 +02:00
Improved tio output
Added titles and indentation to commands output for clearer separation when firing commands repeatedly. Also added print of tio version and quit command hint at launch.
This commit is contained in:
parent
dc455eb0c2
commit
8ddabb1908
1 changed files with 18 additions and 9 deletions
|
|
@ -32,6 +32,7 @@
|
|||
#include <termios.h>
|
||||
#include <stdbool.h>
|
||||
#include <errno.h>
|
||||
#include "config.h"
|
||||
#include "tio/tty.h"
|
||||
#include "tio/print.h"
|
||||
#include "tio/options.h"
|
||||
|
|
@ -69,6 +70,7 @@ void handle_command_sequence(char input_char, char previous_char, char *output_c
|
|||
switch (input_char)
|
||||
{
|
||||
case KEY_I:
|
||||
tio_printf("Settings information:");
|
||||
tio_printf(" TTY device: %s", option.tty_device);
|
||||
tio_printf(" Baudrate: %d", option.baudrate);
|
||||
tio_printf(" Databits: %d", option.databits);
|
||||
|
|
@ -77,7 +79,9 @@ void handle_command_sequence(char input_char, char previous_char, char *output_c
|
|||
tio_printf(" Parity: %s", option.parity);
|
||||
tio_printf(" Output delay: %d", option.output_delay);
|
||||
if (option.log)
|
||||
{
|
||||
tio_printf(" Log file: %s", option.log_filename);
|
||||
}
|
||||
*forward = false;
|
||||
break;
|
||||
case KEY_Q:
|
||||
|
|
@ -89,6 +93,7 @@ void handle_command_sequence(char input_char, char previous_char, char *output_c
|
|||
break;
|
||||
case KEY_S:
|
||||
/* Show tx/rx statistics upon ctrl-t s sequence */
|
||||
tio_printf("Statistics:");
|
||||
tio_printf(" Sent %ld bytes, received %ld bytes", tx_total, rx_total);
|
||||
*forward = false;
|
||||
break;
|
||||
|
|
@ -116,6 +121,10 @@ void wait_for_tty_device(void)
|
|||
/* Don't wait first time */
|
||||
tv.tv_sec = 0;
|
||||
tv.tv_usec = 1;
|
||||
|
||||
tio_printf("tio v%s", VERSION);
|
||||
tio_printf("Press ctrl-t + q to quit");
|
||||
|
||||
first = false;
|
||||
} else
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue