diff --git a/.gitignore b/.gitignore index 3c3629e64..be3563007 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,3 @@ node_modules +.venv +*.class \ No newline at end of file diff --git a/implement-cowsay/cow.py b/implement-cowsay/cow.py new file mode 100644 index 000000000..f7c647e2b --- /dev/null +++ b/implement-cowsay/cow.py @@ -0,0 +1,21 @@ +import argparse +import cowsay + +available_animals = cowsay.CHARS + +parser = argparse.ArgumentParser(prog="cowsay") +parser.add_argument("message", nargs="+", help="What the animal will say") +parser.add_argument( + "--animal", + choices=available_animals.keys(), + default="cow", + help="The animal that will say the word", +) + +args = parser.parse_args() + +message_joined = " ".join(args.message) + +animal = args.animal + +getattr(cowsay, animal)(message_joined) 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