We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d3857c2 commit 900e052Copy full SHA for 900e052
1 file changed
implement-cowsay/cow.py
@@ -0,0 +1,28 @@
1
+import argparse
2
+import cowsay
3
+
4
+parser = argparse.ArgumentParser(
5
+ prog="cowsay",
6
+ description="Make animals say things"
7
+)
8
9
+parser.add_argument(
10
+ "--animal",
11
+ choices=cowsay.char_names,
12
+ default="cow",
13
+ help="The animal to be saying things."
14
15
16
17
+ "message",
18
+ nargs="+",
19
+ help="The message to say."
20
21
22
+args = parser.parse_args()
23
24
+message = " ".join(args.message)
25
26
+animal = getattr(cowsay, args.animal)
27
28
+animal(message)
0 commit comments