London|25-SDC-NOV| FATMA DEGIRMENCI | Sprint 4|Implement cowsay#290
London|25-SDC-NOV| FATMA DEGIRMENCI | Sprint 4|Implement cowsay#290fatmaevin wants to merge 3 commits intoCodeYourFuture:mainfrom
Conversation
LonMcGregor
left a comment
There was a problem hiding this comment.
Good start. I have left some comments. Also, can you include a requirements file so I know which library you intend to use?
implement-cowsay/cow.py
Outdated
| if animal not in animals: | ||
| print(f"Invalid animal. Supported animals are: {', '.join(animals)}") | ||
| exit(1) | ||
| cowsay.char_funcs[animal](args.text) |
There was a problem hiding this comment.
What happens if I give my arguments as plain text, without quotes?
There was a problem hiding this comment.
Thanks for the feedback
I’ve updated the script to support multi-word text without quotes by using (nargs="+") for the text argument.
implement-cowsay/cow.py
Outdated
|
|
||
| parser = argparse.ArgumentParser(description="implement Cowsay command") | ||
| parser.add_argument("text", help="Text to be displayed") | ||
| parser.add_argument("--animal", help="Animal to say the text", default="cow") |
There was a problem hiding this comment.
Can you get the help to show the list of possible animals?
There was a problem hiding this comment.
Thank you for your feedback. I’ve added a list of all cowsay animals to the help output so can see the available options.
|
Great, this is almost complete. Can you check my earlier comment about requirements? |
|
Good work, this is complete now |
Self checklist