Skip to content

Commit 159fc06

Browse files
committed
Update example output
1 parent 332cc30 commit 159fc06

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,13 @@ named after the main module:
4646
count: Annotated[int, typer.Option(help="Number of times to greet the person")] = 1
4747
):
4848
greeting = "Greetings, "
49+
if doctor and not title:
50+
title = "Dr."
4951
if not name:
5052
if title:
5153
name = title.lower().rstrip(".")
5254
else:
5355
name = "friend"
54-
if doctor and not title:
55-
title = "Dr."
5656
if title:
5757
greeting += f"{title} "
5858
greeting += f"{name}!"
@@ -136,8 +136,8 @@ Let's test it:
136136
137137
$ greet
138138
Greetings, friend!
139-
$ greet --knight Lancelot
140-
Greetings, Sir Lancelot!
139+
$ greet --doctor Brennan
140+
Greetings, Dr. Brennan!
141141
$ greet --title Ms. Parks
142142
Greetings, Ms. Parks!
143143
$ greet --title Mr.
@@ -151,7 +151,7 @@ To just run the program without installing it permanently, use ``pipx run``, whi
151151

152152
.. code-block:: console
153153
154-
$ pipx run --spec . greet --knight
154+
$ pipx run --spec . greet --doctor
155155
156156
This syntax is a bit impractical, however; as the name of the entry point we defined above does not match the package name,
157157
we need to state explicitly which executable script to run (even though there is only on in existence).
@@ -170,7 +170,7 @@ default one and run it, which makes this command possible:
170170

171171
.. code-block:: console
172172
173-
$ pipx run . --knight
173+
$ pipx run . --doctor
174174
175175
Conclusion
176176
==========

0 commit comments

Comments
 (0)