Skip to content

Commit e9fa8b3

Browse files
Add initial implementation of cowsay script and add cowsay to requirements.txt
1 parent 407b010 commit e9fa8b3

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

implement-cowsay/cow.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import argparse
2+
import cowsay
3+
4+
parser = argparse.ArgumentParser(
5+
prog="cowsay",
6+
description="Make animals say things",
7+
)
8+
parser.add_argument("--animal", choices=cowsay.char_names, default="cow", help="The animal to be saying things.")
9+
parser.add_argument("message", nargs="+", help="The message for the animal to say.")
10+
11+
args = parser.parse_args()
12+
13+
getattr(cowsay, args.animal)(" ".join(args.message))

implement-cowsay/requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
cowsay

0 commit comments

Comments
 (0)