If you pass cowsay -v or -V (asking for a version, but incorrectly), or some other unknown option, cowsay seems to hang after the error message.
[cowsay] $ ./bin/cowsay -V
Unknown option: V
That's because it's doing the default behavior of reading from stdin and waiting for input.
Might be better for it to just die and exit upon any unknown options.
Maybe should go broader, and ignore stdin if it's a terminal, so you only get the "read from stdin" behavior when piping to it. Might fix unintentional hangs in some cases.
If you pass
cowsay -v
or-V
(asking for a version, but incorrectly), or some other unknown option, cowsay seems to hang after the error message.That's because it's doing the default behavior of reading from stdin and waiting for input.
Might be better for it to just die and exit upon any unknown options.
Maybe should go broader, and ignore stdin if it's a terminal, so you only get the "read from stdin" behavior when piping to it. Might fix unintentional hangs in some cases.