Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions implement-cowsay/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.venv/
16 changes: 16 additions & 0 deletions implement-cowsay/cow.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import argparse
import cowsay

animals = list(cowsay.char_funcs.keys())

parser = argparse.ArgumentParser(description="implement Cowsay command")
parser.add_argument("text",nargs="+" ,help="Text to be displayed")
parser.add_argument("--animal", help=f"Animal to say the text (choices: {', '.join(animals)})", default="cow",choices=animals)
args = parser.parse_args()

text = " ".join(args.text)
animal = args.animal

cowsay.char_funcs[animal](text)