diff --git a/implement-cowsay/.gitignore b/implement-cowsay/.gitignore new file mode 100644 index 000000000..83bf45394 --- /dev/null +++ b/implement-cowsay/.gitignore @@ -0,0 +1,2 @@ +.venv +.vscode/* \ No newline at end of file diff --git a/implement-cowsay/cow.py b/implement-cowsay/cow.py new file mode 100644 index 000000000..846a33928 --- /dev/null +++ b/implement-cowsay/cow.py @@ -0,0 +1,21 @@ +import argparse +import cowsay + +available_animals = cowsay.CHARS + +parser = argparse.ArgumentParser(prog="cowsay", description="Make animals say things") +parser.add_argument("message", nargs="+", help="here is the message that the animal will say") +parser.add_argument( + "--animal", + choices=available_animals.keys(), + default="cow", + help="The animal to be saying things.", +) + +args = parser.parse_args() + +message_joined = " ".join(args.message) + +animal = args.animal + +getattr(cowsay, animal)(message_joined) \ No newline at end of file diff --git a/implement-cowsay/requirements.txt b/implement-cowsay/requirements.txt new file mode 100644 index 000000000..cc5571034 --- /dev/null +++ b/implement-cowsay/requirements.txt @@ -0,0 +1 @@ +cowsay \ No newline at end of file