Add list serial devices feature

For convenience, add a --list-devices option which lists the available
serial devices.
This commit is contained in:
Martin Lund 2022-02-08 22:44:48 +01:00
parent 6310f28d2c
commit 7a2a18232d
8 changed files with 55 additions and 2 deletions

View file

@ -31,7 +31,7 @@
int main(int argc, char *argv[])
{
int status;
int status = 0;
/* Install error exit handler */
atexit(&error_exit);
@ -39,6 +39,13 @@ int main(int argc, char *argv[])
/* Parse options */
parse_options(argc, argv);
/* List available serial devices */
if (option.list_devices)
{
list_serial_devices();
return status;
}
/* Configure tty device */
tty_configure();