Closed ndim closed 2 months ago
Your expectation is correct. cowsay -h
should just display the help and then exit. This is a bug, and a dumb one. Should be an easy fix though.
Thanks for the report!
Fixed in https://github.com/cowsay-org/cowsay/commit/46114bf10d40a3acd80604bc2db7a99705644842.
Your analysis here was correct. For the special case of handling cowsay -h
(instead of cowsay --help
), it was calling the function to display the help screen, but then not actually calling exit()
to bail, and it fell through and moved on to the regular main case behavior, which in the absence of command-line positional arguments, read the message from stdin and displayed it.
Going out in cowsay 3.9.0. Or maybe earlier, like 3.8.1 or 3.8.2.
When running
cowsay -h
,cowsay
prints the help message and proceeds to wait for data on stdin, then finally prints a cow which says the data from stdin as ifcowsay
had been called.My expectation is for
cowsay -h
to print the help message and exit the program.As it is,
cowsay -h
does what I would expectcowsay -h; cowsay
to do.