Skip to content

Commit 1bff274

Browse files
committed
use cowsay library to show user-supplied text
1 parent e328bd5 commit 1bff274

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-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+
2+
import argparse
3+
import cowsay
4+
5+
parser = argparse.ArgumentParser(
6+
prog="cowsay",
7+
description="Make animals say things",
8+
)
9+
parser.add_argument("--animal", default="cow", help="The animal to be saying things.", choices=cowsay.char_names)
10+
parser.add_argument("message", nargs="+", help="The message to say.")
11+
args = parser.parse_args()
12+
13+
cowsay.char_funcs[args.animal](" ".join(args.message))

0 commit comments

Comments
 (0)