Skip to content

Commit d75fa49

Browse files
committed
feat: add cowsay CLI tool
1 parent 4350f48 commit d75fa49

2 files changed

Lines changed: 19 additions & 0 deletions

File tree

implement-cowsay/cow.py

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

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)