Skip to content

Commit 332cc30

Browse files
committed
Use a more obviously gender neutral title
1 parent c327427 commit 332cc30

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

source/guides/creating-command-line-tools.rst

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ named after the main module:
4242
def greet(
4343
name: Annotated[str, typer.Argument(help="The (last, if --title is given) name of the person to greet")] = "",
4444
title: Annotated[str, typer.Option(help="The preferred title of the person to greet")] = "",
45-
knight: Annotated[bool, typer.Option(help="Whether the person is a knight")] = False,
45+
doctor: Annotated[bool, typer.Option(help="Whether the person is a doctor (MD or PhD)")] = False,
4646
count: Annotated[int, typer.Option(help="Number of times to greet the person")] = 1
4747
):
4848
greeting = "Greetings, "
@@ -51,13 +51,10 @@ named after the main module:
5151
name = title.lower().rstrip(".")
5252
else:
5353
name = "friend"
54-
if title or knight:
55-
salutation = ""
56-
if title:
57-
salutation = title
58-
elif knight:
59-
salutation = "Sir "
60-
greeting += salutation
54+
if doctor and not title:
55+
title = "Dr."
56+
if title:
57+
greeting += f"{title} "
6158
greeting += f"{name}!"
6259
for i in range(0, count):
6360
print(greeting)

0 commit comments

Comments
 (0)