Skip to content

Commit f3d6575

Browse files
committed
code now works with --animal and throw error message
1 parent 95cdb2e commit f3d6575

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

implement-cowsay/cow.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,11 @@
88
valid_animals=cowsay.char_names;
99
parser.add_argument("--animal",
1010
choices=valid_animals,
11-
help=" The animal to be saying things.")
11+
help=" The animal to be saying things.",
12+
default="cow")
1213

1314
args=parser.parse_args();
15+
getattr(cowsay,args.animal)(args.message)
1416
# args=sys.argv[1:]
1517
# print(sys.argv)
1618
# flags=list(filter(lambda arg : arg.startswith("-"),args))

0 commit comments

Comments
 (0)