File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed
Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -10,18 +10,17 @@ def main():
1010 description = "Make animals say things"
1111 )
1212
13- parser .add_argument ("--animal" , choices = animals , help = "The animal to be saying things." )
13+ parser .add_argument ("--animal" , choices = animals , default = "cow" , help = "The animal to be saying things." )
1414 parser .add_argument ("message" , nargs = "+" , help = "The message to say." )
1515
1616 args = parser .parse_args ()
1717
1818 # Join all message words into a single string
1919 message = " " .join (args .message )
2020
21- if args .animal :
22- cowsay .char_funcs [args .animal ](message )
23- else :
24- cowsay .cow (message )
21+ # Output the message using the selected animal or the default cow
22+ cowsay .char_funcs [args .animal ](message )
23+
2524
2625if __name__ == "__main__" :
2726 main ()
You can’t perform that action at this time.
0 commit comments