optcli.c: select a suitable input tty for -i mode
commit9de64e14bcdc16c1cb3983cd7a8e04769c2cb524
authorKyle J. McKay <mackyle@gmail.com>
Sat, 19 Aug 2023 00:36:20 +0000 (18 17:36 -0700)
committerKyle J. McKay <mackyle@gmail.com>
Sat, 19 Aug 2023 00:36:20 +0000 (18 17:36 -0700)
tree17ad35a65ac606a71193c3ef0f7bb043c0216a44
parent36eca470fd7822a3c4cf72fd13801e9d547b1932
optcli.c: select a suitable input tty for -i mode

Try to find a suitable input tty for monitoring when -i mode has
been requested.

Choose the first of stdin, stderr, stdout that is a readable tty.

If none of them are readable ttys, emit a warning and disable -i.
otpcli.c