Cleanup list devices code

This commit is contained in:
Martin Lund 2022-06-11 23:14:18 +02:00
parent a0d4be068b
commit bf749aead4
3 changed files with 3 additions and 15 deletions

View file

@ -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++;