From e9fa8b3b6a790afaadddb24934f24dbdf6702322 Mon Sep 17 00:00:00 2001 From: Geraldine-Edwards Date: Fri, 28 Nov 2025 21:35:12 +0000 Subject: [PATCH] Add initial implementation of cowsay script and add cowsay to requirements.txt --- implement-cowsay/cow.py | 13 +++++++++++++ implement-cowsay/requirements.txt | 1 + 2 files changed, 14 insertions(+) create mode 100644 implement-cowsay/cow.py create mode 100644 implement-cowsay/requirements.txt diff --git a/implement-cowsay/cow.py b/implement-cowsay/cow.py new file mode 100644 index 00000000..baef86e8 --- /dev/null +++ b/implement-cowsay/cow.py @@ -0,0 +1,13 @@ +import argparse +import cowsay + +parser = argparse.ArgumentParser( + prog="cowsay", + description="Make animals say things", +) +parser.add_argument("--animal", choices=cowsay.char_names, default="cow", help="The animal to be saying things.") +parser.add_argument("message", nargs="+", help="The message for the animal to say.") + +args = parser.parse_args() + +getattr(cowsay, args.animal)(" ".join(args.message)) \ No newline at end of file diff --git a/implement-cowsay/requirements.txt b/implement-cowsay/requirements.txt new file mode 100644 index 00000000..cc557103 --- /dev/null +++ b/implement-cowsay/requirements.txt @@ -0,0 +1 @@ +cowsay \ No newline at end of file