rua
rua copied to clipboard
consider tty availability to decide switching to /dev/stdin for shellcheck
Currently, if you invoke rua shellcheck (without the last argument), rua will take /dev/stdin as its argument. That might generally be a good idea if you want to use the tool like cat file | rua shellcheck (also known as rua shellcheck < file). But if you didn't pipe any file in, rua shellcheck will be stuck waiting for user-s input, same as a bare cat will do.
The proposal is to make a tty check and exit early if it is available (nothing is piped in).
P.S. Also need to verify if tty-s indeed works as I describe. I'm not 100% sure myself, but I expect so.