cowsay-python icon indicating copy to clipboard operation
cowsay-python copied to clipboard

Add the ability to read from stdin

Open AlphaGameDeveloper opened this issue 9 months ago • 0 comments

This pull request includes several changes to the cowsay/__main__.py file to enhance its functionality and improve user experience. The most important changes include adding support for reading input from stdin, updating the argument parser to provide better help messages, and handling cases where the text argument is not provided.

Enhancements to input handling:

  • cowsay/__main__.py: Added sys import to support reading from stdin.
  • def cli(): Updated the --text argument to read from stdin if not provided and added a help message for clarity.
  • def cli(): Implemented logic to check if input is being piped and handle errors accordingly when the text argument is missing.

AlphaGameDeveloper avatar Mar 06 '25 04:03 AlphaGameDeveloper