mirror of
https://github.com/tio/tio.git
synced 2026-05-01 14:57:59 +02:00
Cleanup list devices code
This commit is contained in:
parent
a0d4be068b
commit
bf749aead4
3 changed files with 3 additions and 15 deletions
|
|
@ -51,13 +51,6 @@ int main(int argc, char *argv[])
|
|||
/* Parse command-line options (2nd pass) */
|
||||
options_parse_final(argc, argv);
|
||||
|
||||
/* List available serial devices */
|
||||
if (option.list_devices)
|
||||
{
|
||||
list_serial_devices();
|
||||
return status;
|
||||
}
|
||||
|
||||
/* Configure tty device */
|
||||
tty_configure();
|
||||
|
||||
|
|
|
|||
|
|
@ -34,6 +34,7 @@
|
|||
#include "error.h"
|
||||
#include "misc.h"
|
||||
#include "print.h"
|
||||
#include "tty.h"
|
||||
|
||||
enum opt_t
|
||||
{
|
||||
|
|
@ -56,7 +57,6 @@ struct option_t option =
|
|||
.log = false,
|
||||
.local_echo = false,
|
||||
.timestamp = TIMESTAMP_NONE,
|
||||
.list_devices = false,
|
||||
.log_filename = NULL,
|
||||
.socket = NULL,
|
||||
.map = "",
|
||||
|
|
@ -264,7 +264,8 @@ void options_parse(int argc, char *argv[])
|
|||
break;
|
||||
|
||||
case 'L':
|
||||
option.list_devices = true;
|
||||
list_serial_devices();
|
||||
exit(EXIT_SUCCESS);
|
||||
break;
|
||||
|
||||
case 'l':
|
||||
|
|
@ -338,11 +339,6 @@ void options_parse(int argc, char *argv[])
|
|||
}
|
||||
}
|
||||
|
||||
if (option.list_devices)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
/* Assume first non-option is the tty device name */
|
||||
if (strcmp(option.tty_device, ""))
|
||||
optind++;
|
||||
|
|
|
|||
|
|
@ -51,7 +51,6 @@ struct option_t
|
|||
bool log;
|
||||
bool local_echo;
|
||||
enum timestamp_t timestamp;
|
||||
bool list_devices;
|
||||
const char *log_filename;
|
||||
const char *map;
|
||||
const char *socket;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue