Skip to content

Commit 128b09d

Browse files
committed
make default argument handlded inside the parser for animal flag
1 parent 01c6b73 commit 128b09d

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

implement-cowsay/cow.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@
99
description="Makes animals say things",
1010
)
1111

12-
parser.add_argument("--animal", help="Select an animal to say anything", choices=listed_animals)
12+
parser.add_argument("--animal", default="cow", help="Select an animal to say anything", choices=listed_animals)
1313
parser.add_argument("message", nargs ="+", help="The message that the animal says")
1414

1515
args = parser.parse_args()
1616

1717
message = " ".join(args.message)
18-
animal = args.animal or "cow"
18+
animal = args.animal
1919

2020

2121
if animal not in listed_animals:

0 commit comments

Comments
 (0)